pub struct WorkflowHandle { /* private fields */ }Expand description
Handle for a concrete workflow run returned by Client::start.
Implementations§
Source§impl WorkflowHandle
impl WorkflowHandle
Sourcepub fn from_ids(client: Client, workflow_id: WorkflowId, run_id: RunId) -> Self
pub fn from_ids(client: Client, workflow_id: WorkflowId, run_id: RunId) -> Self
Constructs a handle from caller-held workflow and run identifiers.
The client is retained so handle methods can delegate through the same
transport, error mapping, payload machinery, and stream implementation as
top-level Client operations.
Sourcepub const fn workflow_id(&self) -> &WorkflowId
pub const fn workflow_id(&self) -> &WorkflowId
Returns the workflow identifier bundled in this handle.
Sourcepub async fn signal(
&self,
name: impl Into<String>,
payload: Payload,
) -> Result<(), ClientError>
pub async fn signal( &self, name: impl Into<String>, payload: Payload, ) -> Result<(), ClientError>
Sends a raw payload signal to this concrete run.
§Errors
Returns ClientError when signal delivery fails.
Sourcepub async fn signal_typed<T>(
&self,
name: impl Into<String>,
value: &T,
) -> Result<(), ClientError>
pub async fn signal_typed<T>( &self, name: impl Into<String>, value: &T, ) -> Result<(), ClientError>
Sends a JSON-typed signal to this concrete run.
§Errors
Returns ClientError::InvalidArgument when serialization fails, or the
delegated signal error otherwise.
Sourcepub async fn query(
&self,
name: impl Into<String>,
args: Payload,
deadline: Duration,
) -> Result<Payload, ClientError>
pub async fn query( &self, name: impl Into<String>, args: Payload, deadline: Duration, ) -> Result<Payload, ClientError>
Queries this concrete run and returns a raw payload result.
§Errors
Returns ClientError when the query fails or times out.
Sourcepub async fn query_typed<A, R>(
&self,
name: impl Into<String>,
args: &A,
deadline: Duration,
) -> Result<R, ClientError>
pub async fn query_typed<A, R>( &self, name: impl Into<String>, args: &A, deadline: Duration, ) -> Result<R, ClientError>
Queries this concrete run and deserializes the result to R.
§Errors
Returns ClientError::InvalidArgument when typed argument serialization
or result decoding fails, or the delegated query error otherwise.
Sourcepub async fn cancel(&self, reason: impl Into<String>) -> Result<(), ClientError>
pub async fn cancel(&self, reason: impl Into<String>) -> Result<(), ClientError>
Requests cancellation of this concrete run.
§Errors
Returns ClientError when the server rejects the cancellation request.
Sourcepub async fn describe(&self) -> Result<WorkflowDescription, ClientError>
pub async fn describe(&self) -> Result<WorkflowDescription, ClientError>
Describes this concrete run.
§Errors
Returns ClientError when the description cannot be fetched or decoded.
Sourcepub fn subscribe(&self) -> EventStream
pub fn subscribe(&self) -> EventStream
Subscribes to events for this workflow.
Trait Implementations§
Source§impl Clone for WorkflowHandle
impl Clone for WorkflowHandle
Source§fn clone(&self) -> WorkflowHandle
fn clone(&self) -> WorkflowHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkflowHandle
impl Debug for WorkflowHandle
impl Eq for WorkflowHandle
Source§impl PartialEq for WorkflowHandle
impl PartialEq for WorkflowHandle
Auto Trait Implementations§
impl !RefUnwindSafe for WorkflowHandle
impl !UnwindSafe for WorkflowHandle
impl Freeze for WorkflowHandle
impl Send for WorkflowHandle
impl Sync for WorkflowHandle
impl Unpin for WorkflowHandle
impl UnsafeUnpin for WorkflowHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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