Trait tc_transact::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§
sourcefn 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 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.
sourcefn subcontext<I: Into<Id> + Send>(&self, id: I) -> Self
fn subcontext<I: Into<Id> + Send>(&self, id: I) -> Self
Create a new transaction context with the given id
.
sourcefn subcontext_unique(&self) -> Self
fn subcontext_unique(&self) -> Self
Create a new transaction subcontext with its own unique [Dir
].
Object Safety§
This trait is not object safe.