Struct sled::ConfigBuilder

source ·
pub struct ConfigBuilder { /* private fields */ }
Expand description

Top-level configuration for the system.

Examples

let _config = pagecache::ConfigBuilder::default()
    .path("/path/to/data".to_owned())
    .cache_capacity(10_000_000_000)
    .use_compression(true)
    .flush_every_ms(Some(1000))
    .snapshot_after_ops(100_000);
// Read-only mode
let _config = pagecache::ConfigBuilder::default()
    .path("/path/to/data".to_owned())
    .read_only(true);

Implementations

Returns a default ConfigBuilder

Set the path of the database (builder).

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

Finalize the configuration.

Panics

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.

number of io buffers

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

b-link tree node size in bytes before splitting

page consolidation threshold

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

whether to run in read-only mode

log base 2 of the number of cache shards

maximum size for the system page cache

whether to use zstd compression

the compression factor to use with zstd compression

number of ms between IO buffer flushes

number of operations between page table snapshots

the proportion of remaining valid pages in the segment

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

the file segment selection mode

snapshot file location

print a performance profile when the Config is dropped

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

perform IO operations on a threadpool

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

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.