pub struct ActivityHandle<ClientT, ActivityT>where
ActivityT: ActivityDefinition,{ /* private fields */ }Expand description
Handle associated with a standalone activity execution that can be used to wait for the result
or to manage execution of the activity. Obtained from
Client::start_activity or
Client::get_activity_handle.
If run_id is set, the handle always targets that specific execution.
If run_id is None, each method call targets the latest run of the specified
activity_id at the time the method is called - this means consecutive
method calls may target different executions if an activity was started again with the same ID.
Implementations§
Source§impl<ClientT, ActivityT> ActivityHandle<ClientT, ActivityT>where
ActivityT: ActivityDefinition,
impl<ClientT, ActivityT> ActivityHandle<ClientT, ActivityT>where
ActivityT: ActivityDefinition,
Sourcepub fn activity_id(&self) -> &str
pub fn activity_id(&self) -> &str
Activity ID this handle is associated with.
Sourcepub fn run_id(&self) -> Option<&str>
pub fn run_id(&self) -> Option<&str>
Run ID of the activity execution this handle is associated with. If None, each method call
targets the latest run of the specified activity_id at the time the
method is called - this means consecutive method calls may target different executions if
an activity was started again with the same ID.
Source§impl<ClientT, ActivityT> ActivityHandle<ClientT, ActivityT>
impl<ClientT, ActivityT> ActivityHandle<ClientT, ActivityT>
Sourcepub async fn result(&self) -> Result<ActivityT::Output, ActivityResultError>
pub async fn result(&self) -> Result<ActivityT::Output, ActivityResultError>
Wait for the activity to complete and fetch its result. If the activity was not successful
(e.g. failed, canceled, timed out), this method returns ActivityResultError::ActivityFailed.
Sourcepub async fn describe(
&self,
options: ActivityDescribeOptions,
) -> Result<ActivityExecutionDescription<ActivityT>, ActivityInteractionError>
pub async fn describe( &self, options: ActivityDescribeOptions, ) -> Result<ActivityExecutionDescription<ActivityT>, ActivityInteractionError>
Describes the current state of the activity execution.
Sourcepub async fn cancel(
&self,
options: ActivityCancelOptions,
) -> Result<(), ActivityInteractionError>
pub async fn cancel( &self, options: ActivityCancelOptions, ) -> Result<(), ActivityInteractionError>
Requests cancellation of the activity. Does not wait for the cancellation to complete.
Sourcepub async fn terminate(
&self,
options: ActivityTerminateOptions,
) -> Result<(), ActivityInteractionError>
pub async fn terminate( &self, options: ActivityTerminateOptions, ) -> Result<(), ActivityInteractionError>
Terminates activity execution.
Auto Trait Implementations§
impl<ClientT, ActivityT> Freeze for ActivityHandle<ClientT, ActivityT>where
ClientT: Freeze,
impl<ClientT, ActivityT> RefUnwindSafe for ActivityHandle<ClientT, ActivityT>where
ClientT: RefUnwindSafe,
ActivityT: RefUnwindSafe,
impl<ClientT, ActivityT> Send for ActivityHandle<ClientT, ActivityT>
impl<ClientT, ActivityT> Sync for ActivityHandle<ClientT, ActivityT>
impl<ClientT, ActivityT> Unpin for ActivityHandle<ClientT, ActivityT>
impl<ClientT, ActivityT> UnsafeUnpin for ActivityHandle<ClientT, ActivityT>where
ClientT: UnsafeUnpin,
impl<ClientT, ActivityT> UnwindSafe for ActivityHandle<ClientT, ActivityT>where
ClientT: UnwindSafe,
ActivityT: UnwindSafe,
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