Trait sled::transaction::Transactional
source · 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>where
F: Fn(&Self::View) -> ConflictableTransactionResult<A, E>,
fn transaction<F, A>(&self, f: F) -> TransactionResult<A, E>where F: Fn(&Self::View) -> ConflictableTransactionResult<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.