Skip to main content

KvEngine

Trait KvEngine 

Source
pub trait KvEngine: Send + Sync {
    type RTx<'a>: ReadTx
       where Self: 'a;
    type WTx<'a>: WriteTx
       where Self: 'a;

    // Required methods
    fn begin_read(&self) -> StoreResult<Self::RTx<'_>>;
    fn begin_write(&self, durability: Durability) -> StoreResult<Self::WTx<'_>>;
}
Expand description

The storage engine: opens read and write transactions.

Send + Sync so one engine handle can be shared across the components that need it. The GAT lifetimes let an engine hand a transaction a borrow of itself (the in-memory engine holds a lock guard for the txn’s lifetime; redb transactions are self-owned, so they simply ignore the lifetime).

Required Associated Types§

Source

type RTx<'a>: ReadTx where Self: 'a

Source

type WTx<'a>: WriteTx where Self: 'a

Required Methods§

Source

fn begin_read(&self) -> StoreResult<Self::RTx<'_>>

Begin a read transaction (a consistent snapshot).

Source

fn begin_write(&self, durability: Durability) -> StoreResult<Self::WTx<'_>>

Begin a single-writer transaction with the given durability.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§