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§
Required Methods§
Sourcefn begin_read(&self) -> StoreResult<Self::RTx<'_>>
fn begin_read(&self) -> StoreResult<Self::RTx<'_>>
Begin a read transaction (a consistent snapshot).
Sourcefn begin_write(&self, durability: Durability) -> StoreResult<Self::WTx<'_>>
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".