Skip to main content

CancellationContext

Struct CancellationContext 

Source
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

Source

pub fn from_value(value: &Value) -> Result<Self>

Read legacy v1 and candidate scoped v2 without granting a new cleanup budget.

Source

pub fn request_id(&self) -> &str

Source

pub fn root_request_id(&self) -> &str

Source

pub fn root_workflow_instance_id(&self) -> &str

Source

pub fn root_workflow_run_id(&self) -> &str

Source

pub fn parent_request_id(&self) -> Option<&str>

Source

pub fn reason(&self) -> Option<&str>

Source

pub fn requester(&self) -> &BTreeMap<String, String>

Source

pub fn source(&self) -> &str

Source

pub fn requested_at(&self) -> DateTime<Utc>

Source

pub fn deadline(&self) -> DateTime<Utc>

Source

pub fn scope_origin(&self) -> Option<&ScopedCancellationContext>

Source

pub fn cause(&self) -> CancellationCause

Why this request was delivered: an ordinary request or timeout cleanup.

Source

pub fn is_timeout(&self) -> bool

Whether this is a timeout-cleanup request (cause: "timeout").

Source

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.

Source

pub fn lineage(&self) -> &[CancellationLineage]

Source

pub fn to_value(&self) -> Value

Detached metadata in the portable context schema.

Trait Implementations§

Source§

impl Clone for CancellationContext

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CancellationContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CancellationContext

Source§

impl PartialEq for CancellationContext

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl Forget for CancellationContext

§

impl Freeze for CancellationContext

§

impl Move for CancellationContext

§

impl RefUnwindSafe for CancellationContext

§

impl Send for CancellationContext
where RawVecInner: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send, NonZero<i32>: Send, Utc: Send, BoxRaw<ScopedCancellationContext>: Send, Weak<Mutex<WorkflowState>>: Send,

§

impl Sync for CancellationContext
where RawVecInner: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync, NonZero<i32>: Sync, Utc: Sync, BoxRaw<ScopedCancellationContext>: Sync, Weak<Mutex<WorkflowState>>: Sync,

§

impl Unpin for CancellationContext
where *const u8 is !null: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin, NonZero<i32>: Unpin, Utc: Unpin, Box<ScopedCancellationContext>: Unpin, *const ArcInner<Mutex<WorkflowState>> is !null: Unpin,

§

impl UnsafeUnpin for CancellationContext

§

impl UnwindSafe for CancellationContext

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more