Skip to main content

TransactionalStore

Trait TransactionalStore 

Source
pub trait TransactionalStore: Send + Sync {
    // Required method
    fn execute_batch(
        &self,
        batch: &TxnBatch,
    ) -> Result<TxnOutcome, TxnStoreError>;
}
Expand description

A backend that can apply a TxnBatch atomically.

Implemented by [crate::datastore::NoxuDatastore] under the noxu feature. The trait is object-safe so the HTTP and PBC servers can hold an Arc<dyn TransactionalStore> without naming the concrete backend.

Required Methods§

Source

fn execute_batch(&self, batch: &TxnBatch) -> Result<TxnOutcome, TxnStoreError>

Apply batch atomically.

§Errors

Returns TxnStoreError::EmptyBatch for an empty batch, TxnStoreError::Conflict when the engine reported a serialization failure (the batch rolled back), or TxnStoreError::Backend for any other engine error.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§