Trait Transaction

Source
pub trait Transaction:
    Send
    + Sync
    + Sized {
    // Required methods
    fn commit(self) -> impl Future<Output = Result<()>> + Send;
    fn revert(self) -> impl Future + Send;
}
Expand description

A unit of atomicity for updating a shared data source.

The methods provided by this trait can be used to write such pending changes back to persistent storage (commit) so that they become visible to other clients of the same underlying storage, and are saved if the process restarts. It also allows pending changes to be rolled back (revert) so that they are never written back to storage and are no longer reflected even through the data source object which was used to make the changes.

Required Methods§

Source

fn commit(self) -> impl Future<Output = Result<()>> + Send

Source

fn revert(self) -> impl Future + Send

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.

Implementors§

Source§

impl<Mode: TransactionMode> Transaction for hotshot_query_service::data_source::storage::sql::Transaction<Mode>

Source§

impl<Types> Transaction for hotshot_query_service::data_source::storage::fs::Transaction<RwLockReadGuard<'_, FileSystemStorageInner<Types>>>
where Types: NodeType, Header<Types>: QueryableHeader<Types>, Payload<Types>: QueryablePayload<Types>,

Source§

impl<Types> Transaction for hotshot_query_service::data_source::storage::fs::Transaction<RwLockWriteGuard<'_, FileSystemStorageInner<Types>>>
where Types: NodeType, Header<Types>: QueryableHeader<Types>, Payload<Types>: QueryablePayload<Types>,