pub struct Config { /* private fields */ }
Expand description
Tree configuration builder
Implementations§
source§impl Config
impl Config
sourcepub fn level_count(self, n: u8) -> Self
pub fn level_count(self, n: u8) -> Self
Sets the amount of levels of the LSM tree (depth of tree).
Defaults to 7, like LevelDB
and RocksDB
.
Panics
Panics if n
is 0.
sourcepub fn level_ratio(self, n: u8) -> Self
pub fn level_ratio(self, n: u8) -> Self
Sets the size ratio between levels of the LSM tree (a.k.a. fanout, growth rate).
Defaults to 10.
Panics
Panics if n
is less than 2.
sourcepub fn block_size(self, block_size: u32) -> Self
pub fn block_size(self, block_size: u32) -> Self
Sets the block size.
Defaults to 4 KiB (4096 bytes).
Panics
Panics if the block size is smaller than 1 KiB (1024 bytes).
sourcepub fn block_cache(self, block_cache: Arc<BlockCache>) -> Self
pub fn block_cache(self, block_cache: Arc<BlockCache>) -> Self
Sets the block cache.
You can create a global BlockCache
and share it between multiple
trees to cap global cache memory usage.
Defaults to a block cache with 8 MiB of capacity per tree.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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