pub struct NodeContext { /* private fields */ }Expand description
Minimal execution context passed to runtime-managed nodes.
Implementations§
Source§impl NodeContext
impl NodeContext
Sourcepub fn new(
workflow_id: WorkflowId,
node_id: NodeId,
execution: ExecutionMetadata,
) -> Self
pub fn new( workflow_id: WorkflowId, node_id: NodeId, execution: ExecutionMetadata, ) -> Self
Create an active node context for one execution attempt.
Sourcepub fn with_cancellation(self, request: CancellationRequest) -> Self
pub fn with_cancellation(self, request: CancellationRequest) -> Self
Create a copy of this context with cancellation requested.
Sourcepub fn with_cancellation_token(self, token: CancellationToken) -> Self
pub fn with_cancellation_token(self, token: CancellationToken) -> Self
Attach a shared cancellation token to this context.
Sourcepub const fn workflow_id(&self) -> &WorkflowId
pub const fn workflow_id(&self) -> &WorkflowId
Workflow currently being executed.
Sourcepub const fn execution(&self) -> &ExecutionMetadata
pub const fn execution(&self) -> &ExecutionMetadata
Execution metadata shared by nodes in the same run.
Sourcepub fn cancellation(&self) -> CancellationState
pub fn cancellation(&self) -> CancellationState
Cancellation state visible to this node.
Sourcepub fn cancellation_token(&self) -> CancellationToken
pub fn cancellation_token(&self) -> CancellationToken
Shared cancellation token visible to this node.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Return whether cancellation has been requested.
Trait Implementations§
Source§impl Clone for NodeContext
impl Clone for NodeContext
Source§fn clone(&self) -> NodeContext
fn clone(&self) -> NodeContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeContext
impl Debug for NodeContext
Source§impl PartialEq for NodeContext
impl PartialEq for NodeContext
Source§fn eq(&self, other: &NodeContext) -> bool
fn eq(&self, other: &NodeContext) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for NodeContext
impl StructuralPartialEq for NodeContext
Auto Trait Implementations§
impl Freeze for NodeContext
impl RefUnwindSafe for NodeContext
impl Send for NodeContext
impl Sync for NodeContext
impl Unpin for NodeContext
impl UnsafeUnpin for NodeContext
impl UnwindSafe for NodeContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).