pub trait Transaction<FE>: Clone + Sized + Send + Sync + 'static {
    // Required methods
    fn id(&self) -> &TxnId;
    fn context<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = TCResult<DirLock<FE>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subcontext<I: Into<Id> + Send>(&self, id: I) -> Self;
    fn subcontext_unique(&self) -> Self;
}
Expand description

Common transaction context properties.

Required Methods§

source

fn id(&self) -> &TxnId

The TxnId of this transaction context.

source

fn context<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = TCResult<DirLock<FE>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Allows locking the filesystem directory of this transaction context, e.g. to cache un-committed state or to compute an intermediate result.

source

fn subcontext<I: Into<Id> + Send>(&self, id: I) -> Self

Create a new transaction context with the given id.

source

fn subcontext_unique(&self) -> Self

Create a new transaction subcontext with its own unique [Dir].

Object Safety§

This trait is not object safe.

Implementors§