pub struct CapabilityTxn<S> { /* private fields */ }Expand description
Atomic capability contribution transaction guarded by Rust typestate.
Only CapabilityTxn<Validated> exposes commit. A prepared transaction
cannot publish, and dropping any uncommitted state transfers all completed
effects to the catalog-owned asynchronous rollback queue.
ⓘ
use a3s_code_core::capability::{CapabilityTxn, Prepared};
fn publish_without_validation(txn: CapabilityTxn<Prepared>) {
let _ = txn.commit();
}Implementations§
Source§impl CapabilityTxn<Staged>
impl CapabilityTxn<Staged>
pub fn stage<A>(
&mut self,
id: CapabilityId,
adapter: A,
) -> Result<&mut Self, CapabilityProjectionError>where
A: CapabilityProjectionAdapter,
pub fn stage_value( &mut self, id: CapabilityId, value: CapabilityValue, ) -> Result<&mut Self, CapabilityProjectionError>
pub async fn prepare( self, cancellation: CancellationToken, ) -> Result<CapabilityTxn<Prepared>, CapabilityProjectionError>
Source§impl CapabilityTxn<Prepared>
impl CapabilityTxn<Prepared>
pub fn validate( self, ) -> Result<CapabilityTxn<Validated>, CapabilityProjectionError>
Source§impl CapabilityTxn<Validated>
impl CapabilityTxn<Validated>
pub fn commit( self, ) -> Result<CapabilityCommitReceipt, CapabilityProjectionError>
Source§impl<S> CapabilityTxn<S>
impl<S> CapabilityTxn<S>
pub fn base(&self) -> Result<&CapabilityCatalogStamp, CapabilityProjectionError>
pub fn target(&self) -> Result<&CapabilitySet, CapabilityProjectionError>
Trait Implementations§
Auto Trait Implementations§
impl<S> !RefUnwindSafe for CapabilityTxn<S>
impl<S> !Sync for CapabilityTxn<S>
impl<S> !UnwindSafe for CapabilityTxn<S>
impl<S> Freeze for CapabilityTxn<S>where
PhantomData<S>: Freeze,
impl<S> Send for CapabilityTxn<S>where
PhantomData<S>: Send,
impl<S> Unpin for CapabilityTxn<S>where
PhantomData<S>: Unpin,
impl<S> UnsafeUnpin for CapabilityTxn<S>where
PhantomData<S>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more