[][src]Struct kv::Config

pub struct Config {
    pub path: PathBuf,
    pub temporary: bool,
    pub use_compression: bool,
    pub flush_every_ms: Option<u64>,
    pub cache_capacity: Option<u64>,
}

Config is used to create a new store

Fields

path: PathBuf

The path field determines where the database will be created

temporary: bool

The temporary field specifies if the database will be destroyed on close

use_compression: bool

Enable compression by setting use_compression to true

flush_every_ms: Option<u64>

Specify the flush frequency

cache_capacity: Option<u64>

Specify the cache capacity

Implementations

impl Config[src]

pub fn new<P: AsRef<Path>>(p: P) -> Config[src]

Create a default configuration object

pub fn save_to<W: Write>(&self, w: W) -> Result<(), Error>[src]

Save Config to an io::Write

pub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>[src]

Save Config to a file

pub fn load_from<R: Read>(r: R) -> Result<Config, Error>[src]

Load configuration from an io::Read

pub fn load<P: AsRef<Path>>(path: P) -> Result<Config, Error>[src]

Load configuration to a file

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

Set compression field

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

Toggle temporary value

pub fn flush_every_ms(self, ms: u64) -> Config[src]

Set flush frequency

pub fn cache_capacity(self, ms: u64) -> Config[src]

Set cache capacity

Trait Implementations

impl Clone for Config[src]

impl Debug for Config[src]

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

impl PartialEq<Config> for Config[src]

impl Serialize for Config[src]

impl StructuralPartialEq for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.