Top-level configuration for the system.
let _config = sled::Config::default() .path("/path/to/data".to_owned()) .cache_capacity(10_000_000_000) .flush_every_ms(Some(1000)) .snapshot_after_ops(100_000);
// Read-only mode let _config = sled::Config::default() .path("/path/to/data".to_owned()) .read_only(true);
Returns a default
Set the path of the database (builder).
Db based on the provided config.
pub fn flush_every_ms(self, to: Option<u64>) -> Self[src]
number of ms between IO buffer flushes
deletes the database after drop. if no path is set, uses /dev/shm on linux
pub fn create_new(self, to: bool) -> Self[src]
attempts to exclusively open the database, failing if it already exists
pub fn cache_capacity(self, to: u64) -> Self[src]
maximum size in bytes for the system page cache
pub fn print_profile_on_drop(self, to: bool) -> Self[src]
print a performance profile when the Config is dropped
pub fn use_compression(self, to: bool) -> Self[src]
whether to use zstd compression
pub fn compression_factor(self, to: i32) -> Self[src]
the compression factor to use with zstd compression
pub fn snapshot_after_ops(self, to: u64) -> Self[src]
number of operations between page table snapshots
pub fn segment_cleanup_threshold(self, to: u8) -> Self[src]
the proportion of remaining valid pages in the segment before GC defragments it
pub fn segment_cleanup_skew(self, to: usize) -> Self[src]
the cleanup threshold skew in percentage points between the first and last segments
pub fn segment_mode(self, to: SegmentMode) -> Self[src]
the file segment selection mode
pub fn snapshot_path(self, to: Option<PathBuf>) -> Self[src]
snapshot file location
pub fn idgen_persist_interval(self, to: u64) -> Self[src]
generated IDs are persisted at this interval. during recovery we skip twice this number
whether to run in read-only mode
impl !RefUnwindSafe for Config
impl !UnwindSafe for Config
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)[src]
type Error = Infallible
The type returned in the event of a conversion error.