pub struct CapabilityScopeHandle<K: ScopeKind> { /* private fields */ }Expand description
Cloneable weak registration handle for one typed capability scope.
A handle can transfer tasks and reversible effects into an active scope, and the permitted marker-specific methods can derive child scopes. It does not retain the scope, its immutable catalog generation, or an upstream A3S Use lease. Once the owner closes or drops the scope, every operation fails closed.
Implementations§
Source§impl CapabilityScopeHandle<Run>
impl CapabilityScopeHandle<Run>
pub fn turn( &self, local_id: impl Into<String>, ceiling: CapabilityCeiling, ) -> Result<CapabilityScope<Turn>, CapabilityScopeError>
pub fn turn_inheriting( &self, local_id: impl Into<String>, ) -> Result<CapabilityScope<Turn>, CapabilityScopeError>
pub fn subtask( &self, local_id: impl Into<String>, ceiling: CapabilityCeiling, ) -> Result<CapabilityScope<Subtask>, CapabilityScopeError>
pub fn subtask_inheriting( &self, local_id: impl Into<String>, ) -> Result<CapabilityScope<Subtask>, CapabilityScopeError>
Source§impl CapabilityScopeHandle<Turn>
impl CapabilityScopeHandle<Turn>
pub fn subtask( &self, local_id: impl Into<String>, ceiling: CapabilityCeiling, ) -> Result<CapabilityScope<Subtask>, CapabilityScopeError>
pub fn subtask_inheriting( &self, local_id: impl Into<String>, ) -> Result<CapabilityScope<Subtask>, CapabilityScopeError>
Source§impl CapabilityScopeHandle<Subtask>
impl CapabilityScopeHandle<Subtask>
pub fn turn( &self, local_id: impl Into<String>, ceiling: CapabilityCeiling, ) -> Result<CapabilityScope<Turn>, CapabilityScopeError>
pub fn turn_inheriting( &self, local_id: impl Into<String>, ) -> Result<CapabilityScope<Turn>, CapabilityScopeError>
pub fn subtask( &self, local_id: impl Into<String>, ceiling: CapabilityCeiling, ) -> Result<CapabilityScope<Subtask>, CapabilityScopeError>
pub fn subtask_inheriting( &self, local_id: impl Into<String>, ) -> Result<CapabilityScope<Subtask>, CapabilityScopeError>
Source§impl<K: ScopeKind> CapabilityScopeHandle<K>
impl<K: ScopeKind> CapabilityScopeHandle<K>
pub fn id(&self) -> &CapabilityScopeId
pub const fn kind(&self) -> CapabilityScopeKind
pub fn is_active(&self) -> bool
pub fn cancellation(&self) -> Result<CancellationToken, CapabilityScopeError>
pub fn register_effect<E>(&self, effect: E) -> Result<(), CapabilityScopeError>where
E: CapabilityEffect,
pub fn spawn_task<F>( &self, name: impl Into<String>, task: F, ) -> Result<SupervisedTaskId, CapabilityScopeError>
pub fn cancel(&self) -> Result<(), CapabilityScopeError>
Trait Implementations§
Source§impl<K: ScopeKind> Clone for CapabilityScopeHandle<K>
impl<K: ScopeKind> Clone for CapabilityScopeHandle<K>
Auto Trait Implementations§
impl<K> Freeze for CapabilityScopeHandle<K>where
PhantomData<K>: Freeze,
impl<K> RefUnwindSafe for CapabilityScopeHandle<K>where
PhantomData<K>: RefUnwindSafe,
impl<K> Send for CapabilityScopeHandle<K>where
PhantomData<K>: Send,
impl<K> Sync for CapabilityScopeHandle<K>where
PhantomData<K>: Sync,
impl<K> Unpin for CapabilityScopeHandle<K>where
PhantomData<K>: Unpin,
impl<K> UnsafeUnpin for CapabilityScopeHandle<K>where
PhantomData<K>: UnsafeUnpin,
impl<K> UnwindSafe for CapabilityScopeHandle<K>where
PhantomData<K>: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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