pub trait Transactional<E = ()> {
type View;
// Required methods
fn make_overlay(&self) -> Result<TransactionalTrees>;
fn view_overlay(overlay: &TransactionalTrees) -> Self::View;
// Provided method
fn transaction<F, A>(&self, f: F) -> TransactionResult<A, E>
where F: Fn(&Self::View) -> ConflictableTransactionResult<A, E> { ... }
}
Expand description
A type that may be transacted on in sled transactions.
Required Associated Types§
Required Methods§
Sourcefn make_overlay(&self) -> Result<TransactionalTrees>
fn make_overlay(&self) -> Result<TransactionalTrees>
An internal function for creating a top-level transactional structure.
Sourcefn view_overlay(overlay: &TransactionalTrees) -> Self::View
fn view_overlay(overlay: &TransactionalTrees) -> Self::View
An internal function for viewing the transactional subcomponents based on the top-level transactional structure.
Provided Methods§
Sourcefn transaction<F, A>(&self, f: F) -> TransactionResult<A, E>
fn transaction<F, A>(&self, f: F) -> TransactionResult<A, E>
Runs a transaction, possibly retrying the passed-in closure if a concurrent conflict is detected that would cause a violation of serializability. This is the only trait method that you’re most likely to use directly.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.