[][src]Struct kv::Store

pub struct Store {
    pub cfg: Config,
    // some fields omitted
}

A Store is used to keep data on disk using LMDB

Fields

cfg: Config

The config field stores the initial configuration values for the given store

Methods

impl Store[src]

pub fn new(config: Config) -> Result<Store, Error>[src]

Create a new store with the given configuration

pub fn bucket<'a, K: Key, V: Value<'a>>(
    &self,
    name: Option<&str>
) -> Result<Bucket<'a, K, V>, Error>
[src]

Get a named bucket

pub fn int_bucket<'a, V: Value<'a>>(
    &self,
    name: Option<&str>
) -> Result<Bucket<'a, Integer, V>, Error>
[src]

Get a named bucket

pub fn with_read_txn<'a, Res, F: FnOnce(&Txn<'a>) -> Result<Res, Error>>(
    &'a self,
    f: F
) -> Result<Res, Error>
[src]

Create a readonly transaction and pass it to the provided function

pub fn with_write_txn<'a, Res, F: FnOnce(&mut Txn<'a>) -> Result<Res, Error>>(
    &'a mut self,
    f: F
) -> Result<Res, Error>
[src]

Create a writable transaction and pass it to the provided function

pub fn read_txn(&self) -> Result<Txn, Error>[src]

Open a readonly transaction

pub fn write_txn(&self) -> Result<Txn, Error>[src]

Open a writable transaction

pub fn sync(&self, force: bool) -> Result<(), Error>[src]

Sync data to disk

pub fn stat(&self) -> Result<Stat, Error>[src]

Get database statistics

Auto Trait Implementations

impl Send for Store

impl Unpin for Store

impl Sync for Store

impl UnwindSafe for Store

impl RefUnwindSafe for Store

Blanket Implementations

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

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

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.

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

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

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