Packages

A thin wrapper around the rust scylla crate: https://crates.io/crates/scylla.

Current section

Files

Jump to
ex_scylla native ex_scylla src execution pool_size.rs
Raw

native/ex_scylla/src/execution/pool_size.rs

use std::convert::TryInto;
use rustler::NifTaggedEnum;
use scylla::transport::session::PoolSize;
#[derive(NifTaggedEnum)]
pub enum ScyllaPoolSize {
PerHost(usize),
PerShard(usize),
}
impl Into<PoolSize> for ScyllaPoolSize {
fn into(self) -> PoolSize {
match self {
Self::PerHost(v) => {
PoolSize::PerHost(v.try_into().expect("invalid per-host pool size"))
}
Self::PerShard(v) => {
PoolSize::PerShard(v.try_into().expect("invalid per-shard pool size"))
}
}
}
}