pub struct Config {
    pub path: PathBuf,
    pub target_file_size: usize,
    pub file_compaction_percent: u8,
    pub max_object_size: usize,
    pub partition_function: fn(object_id: ObjectId, object_size: usize) -> u8,
    pub min_compaction_files: usize,
}

Fields

path: PathBuf

Storage files will be kept here.

target_file_size: usize

Garbage collection will try to keep storage files around this size or smaller.

file_compaction_percent: u8

Remaining live percentage of a file before it’s considered rewritabe.

max_object_size: usize

The ceiling on the largest allocation this system will ever attempt to perform in order to read an object off of disk.

partition_function: fn(object_id: ObjectId, object_size: usize) -> u8

A partitioning function for objects based on object ID and object size. You may override this to cause objects to be written into separate files so that garbage collection may take advantage of locality effects for your workload that are correlated to object identifiers or the size of data.

Ideally, you will colocate objects that have similar expected lifespans. Doing so minimizes the costs of copying live data over time during storage file GC.

min_compaction_files: usize

The minimum number of files within a generation to collect if below the live compaction percent.

Implementations

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

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.