[][src]Struct sled::ConfigBuilder

pub struct ConfigBuilder { /* fields omitted */ }

Top-level configuration for the system.


let _config = pagecache::ConfigBuilder::default()
// Read-only mode
let _config = pagecache::ConfigBuilder::default()


impl ConfigBuilder[src]

pub fn new() -> ConfigBuilder[src]

Returns a default ConfigBuilder

pub fn path<P>(self, path: P) -> ConfigBuilder where
    P: AsRef<Path>, 

Set the path of the database (builder).

pub fn merge_operator(
    mo: fn(&[u8], Option<&[u8]>, &[u8]) -> Option<Vec<u8>>
) -> ConfigBuilder

Set the merge operator that can be relied on during merges in the PageCache.

pub fn build(self) -> Config[src]

Finalize the configuration.


This function will panic if it is not possible to open the files for performing database IO, or if the provided configuration fails some basic sanity checks.

pub fn io_bufs(self, to: usize) -> ConfigBuilder[src]

number of io buffers

pub fn io_buf_size(self, to: usize) -> ConfigBuilder[src]

size of each io flush buffer. MUST be multiple of 512!

b-link tree node size in bytes before splitting

pub fn page_consolidation_threshold(self, to: usize) -> ConfigBuilder[src]

page consolidation threshold

pub fn temporary(self, to: bool) -> ConfigBuilder[src]

deletes the database after drop. if no path is set, uses /dev/shm on linux

pub fn read_only(self, to: bool) -> ConfigBuilder[src]

whether to run in read-only mode

pub fn cache_bits(self, to: usize) -> ConfigBuilder[src]

log base 2 of the number of cache shards

pub fn cache_capacity(self, to: usize) -> ConfigBuilder[src]

maximum size for the system page cache

pub fn use_compression(self, to: bool) -> ConfigBuilder[src]

whether to use zstd compression

pub fn compression_factor(self, to: i32) -> ConfigBuilder[src]

the compression factor to use with zstd compression

pub fn flush_every_ms(self, to: Option<u64>) -> ConfigBuilder[src]

number of ms between IO buffer flushes

pub fn snapshot_after_ops(self, to: usize) -> ConfigBuilder[src]

number of operations between page table snapshots

pub fn segment_cleanup_threshold(self, to: f64) -> ConfigBuilder[src]

the proportion of remaining valid pages in the segment before GC defragments it

pub fn segment_cleanup_skew(self, to: usize) -> ConfigBuilder[src]

the cleanup threshold skew in percentage points between the first and last segments

pub fn segment_mode(self, to: SegmentMode) -> ConfigBuilder[src]

the file segment selection mode

pub fn snapshot_path(self, to: Option<PathBuf>) -> ConfigBuilder[src]

snapshot file location

pub fn print_profile_on_drop(self, to: bool) -> ConfigBuilder[src]

print a performance profile when the Config is dropped

pub fn idgen_persist_interval(self, to: usize) -> ConfigBuilder[src]

generated IDs are persisted at this interval. during recovery we skip twice this number

pub fn async_io(self, to: bool) -> ConfigBuilder[src]

perform IO operations on a threadpool

pub fn async_io_threads(self, to: usize) -> ConfigBuilder[src]

set the number of threads in the IO threadpool. defaults to # logical CPUs.

Trait Implementations

impl Clone for ConfigBuilder[src]

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

impl Default for ConfigBuilder[src]

impl Serialize for ConfigBuilder[src]

impl PartialEq<ConfigBuilder> for ConfigBuilder[src]

impl Send for ConfigBuilder[src]

impl<'de> Deserialize<'de> for ConfigBuilder[src]

impl Debug for ConfigBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 

impl<T> From for T[src]

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized

impl<T> BorrowMut for T where
    T: ?Sized

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>,