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

Common transaction context properties.

Required Methods§

source

fn id(&self) -> &TxnId

The TxnId of this transaction context.

source

fn context(&self) -> &DirLock<FE>

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<'life0, 'async_trait>( &'life0 self, id: Id ) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a new transaction context with the given id.

source

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

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

Object Safety§

This trait is not object safe.

Implementors§