pub struct Config(/* private fields */);
Expand description
Top-level configuration for the system.
Examples
let _config = sled::Config::default()
.path("/path/to/data".to_owned())
.cache_capacity(10_000_000_000)
.flush_every_ms(Some(1000));
Implementations§
source§impl Config
impl Config
sourcepub fn cache_capacity(self, to: u64) -> Self
pub fn cache_capacity(self, to: u64) -> Self
maximum size in bytes for the system page cache
sourcepub fn mode(self, to: Mode) -> Self
pub fn mode(self, to: Mode) -> Self
specify whether the system should run in “small” or “fast” mode
sourcepub fn use_compression(self, to: bool) -> Self
pub fn use_compression(self, to: bool) -> Self
whether to use zstd compression
sourcepub fn compression_factor(self, to: i32) -> Self
pub fn compression_factor(self, to: i32) -> Self
the compression factor to use with zstd compression. Ranges from 1 up to 22. Levels >= 20 are ‘ultra’.
sourcepub fn temporary(self, to: bool) -> Self
pub fn temporary(self, to: bool) -> Self
deletes the database after drop. if no path is set, uses /dev/shm on linux
sourcepub fn create_new(self, to: bool) -> Self
pub fn create_new(self, to: bool) -> Self
attempts to exclusively open the database, failing if it already exists
sourcepub fn print_profile_on_drop(self, to: bool) -> Self
pub fn print_profile_on_drop(self, to: bool) -> Self
print a performance profile when the Config is dropped
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