Trait Transaction

Source
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 workspace directory.

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§