Trait mas_storage::RepositoryTransaction

source ·
pub trait RepositoryTransaction {
    type Error;

    // Required methods
    fn save(self: Box<Self>) -> BoxFuture<'static, Result<(), Self::Error>>;
    fn cancel(self: Box<Self>) -> BoxFuture<'static, Result<(), Self::Error>>;
}
Expand description

A RepositoryTransaction can be saved or cancelled, after a series of operations.

Required Associated Types§

source

type Error

The error type used by the Self::save and Self::cancel functions

Required Methods§

source

fn save(self: Box<Self>) -> BoxFuture<'static, Result<(), Self::Error>>

Commit the transaction

§Errors

Returns an error if the underlying storage backend failed to commit the transaction.

source

fn cancel(self: Box<Self>) -> BoxFuture<'static, Result<(), Self::Error>>

Rollback the transaction

§Errors

Returns an error if the underlying storage backend failed to rollback the transaction.

Implementors§

source§

impl<R, F, E> RepositoryTransaction for MapErr<R, F>
where R: RepositoryTransaction, R::Error: 'static, F: FnMut(R::Error) -> E + Send + Sync + 'static, E: Error,

§

type Error = E