Skip to main content

RepositoryTransaction

Trait 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.

Dyn Compatibility§

This trait is dyn compatible.

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

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,

Source§

type Error = E