Struct cask::CaskOptions [] [src]

pub struct CaskOptions { /* fields omitted */ }

Cask configuration. Provides control over the properties and behavior of the Cask instance.

Examples

use cask::{CaskOptions, SyncStrategy};

let cask = CaskOptions::default()
    .compaction_check_frequency(1200)
    .sync(SyncStrategy::Never)
    .max_file_size(1024 * 1024 * 1024)
    .open("cask.db")
    .unwrap();

Methods

impl CaskOptions
[src]

Generates the base configuration for opening a Cask, from which configuration methods can be chained.

Sets the strategy used to synchronize writes to disk. Defaults to SyncStrategy::Interval(1000).

Sets the maximum file size. Defaults to 2GB.

Sets the maximum size of the file descriptor cache. Defaults to 2048.

Enable or disable background compaction. Defaults to true.

Create Cask if it doesn't exist. Defaults to true.

Sets the frequency of compaction, in seconds. Defaults to 3600.

Sets the time window during which compaction can run. Defaults to [0, 23].

Sets the ratio of dead entries to total entries in a file that will trigger compaction. Defaults to 0.6.

Sets the minimum amount of data occupied by dead entries in a single file that will trigger compaction. Defaults to 512MB.

Sets the ratio of dead entries to total entries in a file that will cause it to be included in a compaction. Defaults to 0.4.

Sets the minimum amount of data occupied by dead entries in a single file that will cause it to be included in a compaction. Defaults to 128MB.

Sets the minimum size a file must have to be excluded from compaction. Defaults to 10MB.

Opens/creates a Cask at path.

Trait Implementations

impl Clone for CaskOptions
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for CaskOptions
[src]

Returns the "default value" for a type. Read more