pub struct SyncWorkflowInterceptorContext { /* private fields */ }Expand description
Workflow execution context available to sync-only inbound interceptors.
Implementations§
Source§impl SyncWorkflowInterceptorContext
impl SyncWorkflowInterceptorContext
Sourcepub fn context_value<K>(&self) -> Option<Rc<<K as WorkflowContextKey>::Value>>where
K: WorkflowContextKey,
pub fn context_value<K>(&self) -> Option<Rc<<K as WorkflowContextKey>::Value>>where
K: WorkflowContextKey,
Return the value associated with key type K in the current workflow context scope.
Sourcepub fn with_context_value<K, R>(
&self,
value: <K as WorkflowContextKey>::Value,
f: impl FnOnce() -> R,
) -> Rwhere
K: WorkflowContextKey,
pub fn with_context_value<K, R>(
&self,
value: <K as WorkflowContextKey>::Value,
f: impl FnOnce() -> R,
) -> Rwhere
K: WorkflowContextKey,
Run synchronous interceptor code with value installed for key type K.
This is intended for query and update-validator interceptor chains, which cannot await.
Sourcepub fn workflow_id(&self) -> &str
pub fn workflow_id(&self) -> &str
Return the workflow’s unique identifier.
Sourcepub fn task_queue(&self) -> &str
pub fn task_queue(&self) -> &str
Return the task queue the workflow is executing in.
Sourcepub fn workflow_type(&self) -> &str
pub fn workflow_type(&self) -> &str
Return the workflow type name.
Sourcepub fn cancellation_token(&self) -> WorkflowCancellationToken
pub fn cancellation_token(&self) -> WorkflowCancellationToken
Return the workflow’s root cancellation token.
Sourcepub fn workflow_time(&self) -> Option<SystemTime>
pub fn workflow_time(&self) -> Option<SystemTime>
Return the current time according to the workflow.
Sourcepub fn history_length(&self) -> u32
pub fn history_length(&self) -> u32
Return the length of history so far at this point in the workflow.
Sourcepub fn search_attributes(&self) -> SearchAttributes
pub fn search_attributes(&self) -> SearchAttributes
Return current values for workflow search attributes.
Sourcepub fn is_replaying(&self) -> bool
pub fn is_replaying(&self) -> bool
Returns true if the current workflow task is happening under replay.
Sourcepub fn is_replaying_history_events(&self) -> bool
pub fn is_replaying_history_events(&self) -> bool
Returns true if the current work is replaying history events.
Sourcepub fn payload_converter(&self) -> &PayloadConverter
pub fn payload_converter(&self) -> &PayloadConverter
Returns the payload converter used by the worker running this workflow.
Trait Implementations§
Source§impl Clone for SyncWorkflowInterceptorContext
impl Clone for SyncWorkflowInterceptorContext
Source§fn clone(&self) -> SyncWorkflowInterceptorContext
fn clone(&self) -> SyncWorkflowInterceptorContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SyncWorkflowInterceptorContext
impl !Send for SyncWorkflowInterceptorContext
impl !Sync for SyncWorkflowInterceptorContext
impl !UnwindSafe for SyncWorkflowInterceptorContext
impl Freeze for SyncWorkflowInterceptorContext
impl Unpin for SyncWorkflowInterceptorContext
impl UnsafeUnpin for SyncWorkflowInterceptorContext
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
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: 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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request