pub struct Config(_);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 path<P>(self, path: P) -> Configwhere
P: AsRef<Path>,
pub fn path<P>(self, path: P) -> Configwhere
P: AsRef<Path>,
Set the path of the database (builder).
sourcepub fn cache_capacity(self, to: u64) -> Config
pub fn cache_capacity(self, to: u64) -> Config
maximum size in bytes for the system page cache
sourcepub fn mode(self, to: Mode) -> Config
pub fn mode(self, to: Mode) -> Config
specify whether the system should run in “small” or “fast” mode
sourcepub fn use_compression(self, to: bool) -> Config
pub fn use_compression(self, to: bool) -> Config
whether to use zstd compression
sourcepub fn compression_factor(self, to: i32) -> Config
pub fn compression_factor(self, to: i32) -> Config
the compression factor to use with zstd compression. Ranges from 1 up to 22. Levels >= 20 are ‘ultra’.
sourcepub fn temporary(self, to: bool) -> Config
pub fn temporary(self, to: bool) -> Config
deletes the database after drop. if no path is set, uses /dev/shm on linux
sourcepub fn create_new(self, to: bool) -> Config
pub fn create_new(self, to: bool) -> Config
attempts to exclusively open the database, failing if it already exists
sourcepub fn print_profile_on_drop(self, to: bool) -> Config
pub fn print_profile_on_drop(self, to: bool) -> Config
print a performance profile when the Config is dropped