Struct grebedb::Options[][src]

pub struct Options {
    pub open_mode: OpenMode,
    pub keys_per_node: usize,
    pub page_cache_size: usize,
    pub file_locking: bool,
    pub file_sync: SyncOption,
    pub automatic_flush: bool,
    pub automatic_flush_threshold: usize,
    pub compression_level: CompressionLevel,
}

Database configuration options.

Fields

open_mode: OpenMode

Option when opening a database. Default: LoadOrCreate.

keys_per_node: usize

Maximum number of keys per node. Default: 1024.

This value specifies the threshold when node is split into two and the tree is rebalanced.

page_cache_size: usize

Number of pages held in memory cache. Default: 64.

file_locking: bool

Whether to use file locking to prevent corruption by multiple processes. Default: true.

file_sync: SyncOption

Level of file synchronization to increase durability on disk file systems. Default: Data

automatic_flush: bool

Whether to flush the data to the file system periodically when a database operation is performed. Default: true.

When true, data is flushed when the database is dropped or when enough modifications accumulate. Setting this option to false allows you to manually persist changes at more optimal points.

There is no background maintenance thread that does automatic flushing; automatic flushing occurs when a database modifying function, such as put() or remove(), is called.

automatic_flush_threshold: usize

Number of modifications required for automatic flush to be considered. Default: 2048

When the threshold is reached after 300 seconds, or the threshold × 2 is reached after 60 seconds, a flush is scheduled to be performed on the next modification.

compression_level: CompressionLevel

Compression level for each page. Default: Low.

Trait Implementations

impl Clone for Options[src]

impl Debug for Options[src]

impl Default for Options[src]

Auto Trait Implementations

impl RefUnwindSafe for Options

impl Send for Options

impl Sync for Options

impl Unpin for Options

impl UnwindSafe for Options

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.