[][src]Struct kv::Store

pub struct Store { /* fields omitted */ }

Store is used to read/write data to disk using sled

Implementations

impl Store[src]

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

Create a new store from the given config

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

Get the store's path

pub fn generate_id(&self) -> Result<u64, Error>[src]

Generate monotonic ID

pub fn buckets(&self) -> Vec<String>[src]

Get a list of bucket names

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

Open a new bucket

pub fn drop_bucket<S: AsRef<str>>(&self, name: S) -> Result<(), Error>[src]

Remove a bucket from the store

pub fn size_on_disk(&self) -> Result<u64, Error>[src]

Returns the size on disk in bytes

pub fn export(
    &self
) -> Vec<(Vec<u8>, Vec<u8>, impl Iterator<Item = Vec<Vec<u8>>>)>
[src]

Export entire database

pub fn import(
    &self,
    export: Vec<(Vec<u8>, Vec<u8>, impl Iterator<Item = Vec<Vec<u8>>>)>
)
[src]

Import from database export

Trait Implementations

impl Clone for Store[src]

impl Debug for Store[src]

Auto Trait Implementations

impl !RefUnwindSafe for Store

impl Send for Store

impl Sync for Store

impl Unpin for Store

impl !UnwindSafe for Store

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.