pub struct KvBuilder { /* private fields */ }Expand description
Builder for FabricKvStore.
§Example
use grafos_kv::KvBuilder;
let mut kv = KvBuilder::new()
.hot_buckets(128)
.default_ttl_secs(60)
.build()?;Implementations§
Source§impl KvBuilder
impl KvBuilder
pub fn new() -> Self
Sourcepub fn hot_buckets(self, n: usize) -> Self
pub fn hot_buckets(self, n: usize) -> Self
Set the number of buckets for the hot-tier hash map.
Sourcepub fn default_ttl_secs(self, secs: u32) -> Self
pub fn default_ttl_secs(self, secs: u32) -> Self
Set the default TTL in seconds for keys without an explicit TTL.
Sourcepub fn key_stride(self, stride: usize) -> Self
pub fn key_stride(self, stride: usize) -> Self
Set the key stride (max serialized key size in bytes).
Sourcepub fn value_stride(self, stride: usize) -> Self
pub fn value_stride(self, stride: usize) -> Self
Set the value stride (max serialized KvEntry size in bytes).
Sourcepub fn build(self) -> Result<FabricKvStore>
pub fn build(self) -> Result<FabricKvStore>
Build the FabricKvStore.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KvBuilder
impl RefUnwindSafe for KvBuilder
impl Send for KvBuilder
impl Sync for KvBuilder
impl Unpin for KvBuilder
impl UnwindSafe for KvBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more