Struct lsm::Database[][src]

pub struct Database<K: KV_Trait, V: KV_Trait> { /* fields omitted */ }

The main database structure This struct can be accessed concurrently and you should never instantiate it more than once for the same on-disk files

Implementations

impl<K: 'static + KV_Trait, V: 'static + KV_Trait> Database<K, V>[src]

pub async fn new(mode: StartMode) -> Self[src]

Create a new database instance with default parameters

pub async fn new_with_params(mode: StartMode, params: Params) -> Self[src]

Create a new database instance with specific parameters

pub async fn get(&self, key: &K) -> Option<V>[src]

Will deserialize V from the raw data (avoids an additional copy)

pub async fn put(&self, key: &K, value: &V) -> Result<(), WriteError>[src]

Store

pub async fn put_opts(
    &self,
    key: &K,
    value: &V,
    opts: &WriteOptions
) -> Result<(), WriteError>
[src]

pub async fn iter(&self) -> DbIterator<K, V>[src]

pub async fn write(
    &self,
    write_batch: WriteBatch<K, V>
) -> Result<(), WriteError>
[src]

Write a batch of updates to the database

If you only want to write to a single key, use Database::put instead

pub async fn write_opts(
    &self,
    write_batch: WriteBatch<K, V>,
    opts: &WriteOptions
) -> Result<(), WriteError>
[src]

Write a batch of updates to the database This version of write allows you to specfiy options such as “synchronous”

Trait Implementations

impl<K: KV_Trait, V: KV_Trait> Drop for Database<K, V>[src]

Auto Trait Implementations

impl<K, V> !RefUnwindSafe for Database<K, V>

impl<K, V> Send for Database<K, V>

impl<K, V> Sync for Database<K, V>

impl<K, V> Unpin for Database<K, V>

impl<K, V> !UnwindSafe for Database<K, V>

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, 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.