Skip to main content

TransactionalStore

Trait TransactionalStore 

Source
pub trait TransactionalStore: Store + ManifestStore {
    // Provided methods
    fn supports_transactions(&self) -> bool { ... }
    fn commit_transaction(
        &self,
        _node_writes: &[TransactionNodeWrite],
        _root_conditions: &[RootCondition],
        _root_writes: &[RootWrite],
    ) -> Result<TransactionUpdate, Error> { ... }
}
Expand description

Store support for strict atomic transaction commits.

Provided Methods§

Source

fn supports_transactions(&self) -> bool

Whether this backend satisfies the strict transaction contract.

Returning true promises that root conditions are evaluated against one linearizable backend state across threads, handles, and processes that share the store; conflicting commits expose no root writes; all root writes in an applied commit become visible atomically; and every node referenced by an applied root is durably readable before success is acknowledged. Implementations may retain unreachable content-addressed node writes after an error because those nodes do not affect visibility.

Source

fn commit_transaction( &self, _node_writes: &[TransactionNodeWrite], _root_conditions: &[RootCondition], _root_writes: &[RootWrite], ) -> Result<TransactionUpdate, Error>

Validate root conditions, write nodes, and atomically apply root writes.

Conflict must leave every root unchanged. Applied must be returned only after the complete root-write set and all referenced node bytes meet the durability and visibility guarantees of Self::supports_transactions.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T> TransactionalStore for Arc<T>

Source§

fn supports_transactions(&self) -> bool

Source§

fn commit_transaction( &self, node_writes: &[TransactionNodeWrite], root_conditions: &[RootCondition], root_writes: &[RootWrite], ) -> Result<TransactionUpdate, Error>

Implementors§