pub struct CancellationContext { /* private fields */ }Expand description
Original cancellation metadata restored from canonical request history.
Fields and nested metadata have read-only accessors. Descendants retain the original root identity, request time and cleanup budget.
Implementations§
Source§impl CancellationContext
impl CancellationContext
Sourcepub fn from_value(value: &Value) -> Result<Self>
pub fn from_value(value: &Value) -> Result<Self>
Read legacy v1 and candidate scoped v2 without granting a new cleanup budget.
pub fn request_id(&self) -> &str
pub fn root_request_id(&self) -> &str
pub fn root_workflow_instance_id(&self) -> &str
pub fn root_workflow_run_id(&self) -> &str
pub fn parent_request_id(&self) -> Option<&str>
pub fn reason(&self) -> Option<&str>
pub fn requester(&self) -> &BTreeMap<String, String>
pub fn source(&self) -> &str
pub fn requested_at(&self) -> DateTime<Utc>
pub fn deadline(&self) -> DateTime<Utc>
pub fn scope_origin(&self) -> Option<&ScopedCancellationContext>
Sourcepub fn cause(&self) -> CancellationCause
pub fn cause(&self) -> CancellationCause
Why this request was delivered: an ordinary request or timeout cleanup.
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Whether this is a timeout-cleanup request (cause: "timeout").
Sourcepub fn remaining(&self) -> Result<Duration>
pub fn remaining(&self) -> Result<Duration>
Remaining cleanup budget at the last blocking result consumed by this replay.
Never reads host time. Detached metadata, an ended replay, and a missing or invalid committed timestamp return an explicit error. Expiry returns zero.
pub fn lineage(&self) -> &[CancellationLineage]
Trait Implementations§
Source§impl Clone for CancellationContext
impl Clone for CancellationContext
Source§impl Debug for CancellationContext
impl Debug for CancellationContext
impl Eq for CancellationContext
Auto Trait Implementations§
impl Forget for CancellationContext
impl Freeze for CancellationContextwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
NonZero<i32>: Freeze,
Utc: Freeze,
PhantomData<CancellationLineage>: Freeze,
*const ScopedCancellationContext is !null: Freeze,
PhantomData<ScopedCancellationContext>: Freeze,
*const ArcInner<Mutex<WorkflowState>> is !null: Freeze,
impl Move for CancellationContext
impl RefUnwindSafe for CancellationContextwhere
NonZero<i32>: RefUnwindSafe,
Utc: RefUnwindSafe,
Atomic<usize>: RefUnwindSafe,
Mutex<WorkflowState>: RefUnwindSafe,
impl Send for CancellationContext
impl Sync for CancellationContext
impl Unpin for CancellationContext
impl UnsafeUnpin for CancellationContextwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
NonZeroI32Inner: UnsafeUnpin,
Utc: UnsafeUnpin,
PhantomData<CancellationLineage>: UnsafeUnpin,
*const ScopedCancellationContext is !null: UnsafeUnpin,
PhantomData<ScopedCancellationContext>: UnsafeUnpin,
*const ArcInner<Mutex<WorkflowState>> is !null: UnsafeUnpin,
impl UnwindSafe for CancellationContextwhere
RawVecInner: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
NonZero<i32>: UnwindSafe,
Utc: UnwindSafe,
BoxRaw<ScopedCancellationContext>: UnwindSafe,
NonNull<ArcInner<Mutex<WorkflowState>>>: 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