pub struct BaseWorkflowContext { /* private fields */ }Expand description
Non-generic base context containing all workflow execution infrastructure.
This is used internally by futures and commands that don’t need typed workflow state.
Implementations§
Source§impl BaseWorkflowContext
impl BaseWorkflowContext
Sourcepub fn data_converter(&self) -> &DataConverter
pub fn data_converter(&self) -> &DataConverter
Returns the DataConverter associated with this workflow’s worker.
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 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 workflow is replaying (including during queries and update validators), false otherwise.
Sourcepub fn is_replaying_history_events(&self) -> bool
pub fn is_replaying_history_events(&self) -> bool
Return true if the workflow is replaying history events (excluding queries and update validators), false otherwise.
Sourcepub fn payload_converter(&self) -> &PayloadConverter
pub fn payload_converter(&self) -> &PayloadConverter
Returns the payload converter used by the worker running this workflow.
Source§impl BaseWorkflowContext
impl BaseWorkflowContext
Sourcepub fn current_details(&self) -> String
pub fn current_details(&self) -> String
Return the current value of current_details.
Sourcepub fn timer<T>(&self, opts: T) -> impl CancellableFuture<TimerResult> + use<T>where
T: Into<TimerOptions>,
pub fn timer<T>(&self, opts: T) -> impl CancellableFuture<TimerResult> + use<T>where
T: Into<TimerOptions>,
Request to create a timer
Sourcepub fn execute_activity<AD>(
&self,
activity: AD,
input: impl Into<<AD as ActivityDefinition>::Input>,
opts: ActivityOptions,
) -> impl CancellableFuture<Result<<AD as ActivityDefinition>::Output, ActivityExecutionError>>
pub fn execute_activity<AD>( &self, activity: AD, input: impl Into<<AD as ActivityDefinition>::Input>, opts: ActivityOptions, ) -> impl CancellableFuture<Result<<AD as ActivityDefinition>::Output, ActivityExecutionError>>
Request to run an activity
Sourcepub fn execute_local_activity<AD>(
&self,
activity: AD,
input: impl Into<<AD as ActivityDefinition>::Input>,
opts: LocalActivityOptions,
) -> impl CancellableFuture<Result<<AD as ActivityDefinition>::Output, ActivityExecutionError>>
pub fn execute_local_activity<AD>( &self, activity: AD, input: impl Into<<AD as ActivityDefinition>::Input>, opts: LocalActivityOptions, ) -> impl CancellableFuture<Result<<AD as ActivityDefinition>::Output, ActivityExecutionError>>
Request to run a local activity
Trait Implementations§
Source§impl Clone for BaseWorkflowContext
impl Clone for BaseWorkflowContext
Source§fn clone(&self) -> BaseWorkflowContext
fn clone(&self) -> BaseWorkflowContext
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 BaseWorkflowContext
impl !Send for BaseWorkflowContext
impl !Sync for BaseWorkflowContext
impl !UnwindSafe for BaseWorkflowContext
impl Freeze for BaseWorkflowContext
impl Unpin for BaseWorkflowContext
impl UnsafeUnpin for BaseWorkflowContext
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