Struct akd::storage::transaction::Transaction
source · [−]pub struct Transaction { /* private fields */ }
Expand description
Represents an in-memory transaction, keeping a mutable state of the changes. When you “commit” this transaction, you return the collection of values which need to be written to the storage layer including all mutations. Rollback simply empties the transaction state.
Implementations
sourceimpl Transaction
impl Transaction
sourceimpl Transaction
impl Transaction
sourcepub async fn log_metrics(&self, level: Level)
pub async fn log_metrics(&self, level: Level)
Log metrics about the current transaction instance. Metrics will be cleared after log call
sourcepub async fn begin_transaction(&self) -> bool
pub async fn begin_transaction(&self) -> bool
Start a transaction in the storage layer
sourcepub async fn commit_transaction(&self) -> Result<Vec<DbRecord>, StorageError>
pub async fn commit_transaction(&self) -> Result<Vec<DbRecord>, StorageError>
Commit a transaction in the storage layer
sourcepub async fn rollback_transaction(&self) -> Result<(), StorageError>
pub async fn rollback_transaction(&self) -> Result<(), StorageError>
Rollback a transaction
sourcepub async fn is_transaction_active(&self) -> bool
pub async fn is_transaction_active(&self) -> bool
Retrieve a flag determining if there is a transaction active
Trait Implementations
sourceimpl Debug for Transaction
impl Debug for Transaction
sourceimpl Default for Transaction
impl Default for Transaction
impl Send for Transaction
impl Sync for Transaction
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more