pub struct ActivityExecutionDescription<ActivityT = UntypedActivity>where
ActivityT: ActivityDefinition,{ /* private fields */ }Expand description
Contains the current state of the activity execution.
Obtained from ActivityHandle::describe.
Methods that deserialize payloads (e.g. heartbeat_details) use
DataConverter of the client associated with the activity handle.
Implementations§
Source§impl<ActivityT> ActivityExecutionDescription<ActivityT>where
ActivityT: ActivityDefinition,
impl<ActivityT> ActivityExecutionDescription<ActivityT>where
ActivityT: ActivityDefinition,
Sourcepub fn untyped(self) -> ActivityExecutionDescription
pub fn untyped(self) -> ActivityExecutionDescription
Convert to an untyped description object.
Sourcepub fn has_input(&self) -> bool
pub fn has_input(&self) -> bool
True if activity input is present.
See ActivityDescribeOptions::include_input.
Use input or raw_input to retrieve it.
Sourcepub fn raw_input(&self) -> Option<&Payloads>
pub fn raw_input(&self) -> Option<&Payloads>
Raw payload of activity input, if it was requested.
Sourcepub async fn input(
&self,
) -> Result<Option<ActivityT::Input>, PayloadConversionError>
pub async fn input( &self, ) -> Result<Option<ActivityT::Input>, PayloadConversionError>
Deserialize activity input. Returns Ok(None) if not present.
See ActivityDescribeOptions::include_input.
Sourcepub fn has_outcome(&self) -> bool
pub fn has_outcome(&self) -> bool
True if activity outcome is present.
See ActivityDescribeOptions::include_outcome.
Use outcome or raw_outcome to retrieve it.
Sourcepub fn raw_outcome(&self) -> Option<&ActivityExecutionOutcomeValue>
pub fn raw_outcome(&self) -> Option<&ActivityExecutionOutcomeValue>
Raw payload of activity output, if it was requested and available.
Sourcepub async fn outcome(
&self,
) -> Result<Option<Result<ActivityT::Output, IncomingError>>, PayloadConversionError>
pub async fn outcome( &self, ) -> Result<Option<Result<ActivityT::Output, IncomingError>>, PayloadConversionError>
Deserialize activity outcome. Returns Ok(None) if not present.
See ActivityDescribeOptions::include_outcome.
Sourcepub fn run_state(&self) -> PendingActivityState
pub fn run_state(&self) -> PendingActivityState
More detailed breakdown of ActivityExecutionStatus::Running.
Sourcepub fn schedule_to_close_timeout(&self) -> Option<Duration>
pub fn schedule_to_close_timeout(&self) -> Option<Duration>
Indicates how long the caller is willing to wait for an activity completion. Limits how long retries will be attempted.
Sourcepub fn schedule_to_start_timeout(&self) -> Option<Duration>
pub fn schedule_to_start_timeout(&self) -> Option<Duration>
Limits time an activity task can stay in a task queue before a worker picks it up. This timeout is always non-retryable.
Sourcepub fn start_to_close_timeout(&self) -> Option<Duration>
pub fn start_to_close_timeout(&self) -> Option<Duration>
Maximum time a single activity attempt is allowed to execute after being picked up by a worker. This timeout is always retryable.
Sourcepub fn heartbeat_timeout(&self) -> Option<Duration>
pub fn heartbeat_timeout(&self) -> Option<Duration>
Maximum permitted time between successful worker heartbeats.
Sourcepub fn retry_policy(&self) -> Option<RetryPolicy>
pub fn retry_policy(&self) -> Option<RetryPolicy>
The retry policy for the activity.
Sourcepub fn has_heartbeat_details(&self) -> bool
pub fn has_heartbeat_details(&self) -> bool
True if heartbeat details are present.
See ActivityDescribeOptions::include_heartbeat_details.
Use heartbeat_details or
raw_info().heartbeat_details
to retrieve them.
Sourcepub async fn heartbeat_details<T: TemporalDeserializable + 'static>(
&self,
) -> Result<Option<T>, PayloadConversionError>
pub async fn heartbeat_details<T: TemporalDeserializable + 'static>( &self, ) -> Result<Option<T>, PayloadConversionError>
Deserialize heartbeat details. Returns Ok(None) if not present.
See ActivityDescribeOptions::include_heartbeat_details.
Sourcepub fn last_heartbeat_time(&self) -> Option<SystemTime>
pub fn last_heartbeat_time(&self) -> Option<SystemTime>
Time the last heartbeat was recorded.
Sourcepub fn last_started_time(&self) -> Option<SystemTime>
pub fn last_started_time(&self) -> Option<SystemTime>
Time the last attempt was started.
Sourcepub fn attempt(&self) -> u32
pub fn attempt(&self) -> u32
The attempt this activity is currently on. Incremented each time a new attempt is scheduled.
Sourcepub fn execution_duration(&self) -> Option<Duration>
pub fn execution_duration(&self) -> Option<Duration>
How long this activity has been running for, including all attempts and backoff between attempts.
Sourcepub fn expiration_time(&self) -> Option<SystemTime>
pub fn expiration_time(&self) -> Option<SystemTime>
Scheduled time + schedule to close timeout.
Sourcepub fn has_last_failure(&self) -> bool
pub fn has_last_failure(&self) -> bool
True if last failure is present.
See ActivityDescribeOptions::include_last_failure.
Use last_failure() or
raw_info().last_failure
to retrieve it.
Sourcepub fn last_failure(
&self,
) -> Result<Option<IncomingError>, PayloadConversionError>
pub fn last_failure( &self, ) -> Result<Option<IncomingError>, PayloadConversionError>
Deserialize last failure. Returns Ok(None) if not present.
See ActivityDescribeOptions::include_last_failure.
Sourcepub fn last_worker_identity(&self) -> Option<&str>
pub fn last_worker_identity(&self) -> Option<&str>
Identity of the last worker that attempted this activity.
Sourcepub fn current_retry_interval(&self) -> Option<Duration>
pub fn current_retry_interval(&self) -> Option<Duration>
Time from the last attempt failure to the next activity retry.
Sourcepub fn last_attempt_complete_time(&self) -> Option<SystemTime>
pub fn last_attempt_complete_time(&self) -> Option<SystemTime>
The time when the last activity attempt completed.
Sourcepub fn next_attempt_schedule_time(&self) -> Option<SystemTime>
pub fn next_attempt_schedule_time(&self) -> Option<SystemTime>
The time when the next activity attempt will be scheduled.
Sourcepub fn last_deployment_version(&self) -> Option<WorkerDeploymentVersion>
pub fn last_deployment_version(&self) -> Option<WorkerDeploymentVersion>
The Worker Deployment Version this activity was dispatched to most recently.
Sourcepub fn search_attributes(&self) -> Option<SearchAttributes>
pub fn search_attributes(&self) -> Option<SearchAttributes>
Search attributes of the activity.
Sourcepub async fn static_summary(
&self,
) -> Result<Option<String>, PayloadConversionError>
pub async fn static_summary( &self, ) -> Result<Option<String>, PayloadConversionError>
Deserialize static summary that was set when activity was scheduled.
Returns Ok(None) if not present.
Sourcepub async fn static_details(
&self,
) -> Result<Option<String>, PayloadConversionError>
pub async fn static_details( &self, ) -> Result<Option<String>, PayloadConversionError>
Deserialize static details that were set when activity was scheduled.
Returns Ok(None) if not present.
Sourcepub fn canceled_reason(&self) -> Option<&str>
pub fn canceled_reason(&self) -> Option<&str>
Reason for activity cancellation if activity was canceled and reason was provided.
Sourcepub fn start_delay(&self) -> Option<Duration>
pub fn start_delay(&self) -> Option<Duration>
Time to wait before dispatching the first activity task. This delay is not applied to retry attempts.
Trait Implementations§
Source§impl<ActivityT> ActivityExecutionInfoLike for ActivityExecutionDescription<ActivityT>where
ActivityT: ActivityDefinition,
impl<ActivityT> ActivityExecutionInfoLike for ActivityExecutionDescription<ActivityT>where
ActivityT: ActivityDefinition,
Source§fn activity_id(&self) -> &str
fn activity_id(&self) -> &str
Source§fn activity_run_id(&self) -> &str
fn activity_run_id(&self) -> &str
Source§fn activity_type(&self) -> &str
fn activity_type(&self) -> &str
Source§fn schedule_time(&self) -> Option<SystemTime>
fn schedule_time(&self) -> Option<SystemTime>
Source§fn close_time(&self) -> Option<SystemTime>
fn close_time(&self) -> Option<SystemTime>
Source§fn status(&self) -> ActivityExecutionStatus
fn status(&self) -> ActivityExecutionStatus
Source§fn task_queue(&self) -> &str
fn task_queue(&self) -> &str
Source§fn execution_duration(&self) -> Option<Duration>
fn execution_duration(&self) -> Option<Duration>
Auto Trait Implementations§
impl<ActivityT = UntypedActivity> !RefUnwindSafe for ActivityExecutionDescription<ActivityT>
impl<ActivityT = UntypedActivity> !UnwindSafe for ActivityExecutionDescription<ActivityT>
impl<ActivityT> Freeze for ActivityExecutionDescription<ActivityT>
impl<ActivityT> Send for ActivityExecutionDescription<ActivityT>where
ActivityT: Send,
impl<ActivityT> Sync for ActivityExecutionDescription<ActivityT>where
ActivityT: Sync,
impl<ActivityT> Unpin for ActivityExecutionDescription<ActivityT>where
ActivityT: Unpin,
impl<ActivityT> UnsafeUnpin for ActivityExecutionDescription<ActivityT>
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> 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> 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