pub enum WorkflowTermination {
Cancelled {
details: Option<Box<dyn WorkflowOutputValue + Send + Sync>>,
},
Evicted,
ContinueAsNew(Box<ContinueAsNewWorkflowExecution>),
Failed(OutgoingWorkflowError),
}Expand description
Represents ways a workflow can terminate without producing a normal result.
Payload conversion errors returned by workflow operations propagated directly into WorkflowTermination, such as with ?, will fail
the current Workflow Task so it can be retried.
Wrap an error in an ApplicationFailure to explicitly fail the Workflow Execution.
Variants§
Cancelled
The Workflow Execution was cancelled, optionally with user-supplied details.
Evicted
The workflow was evicted and must stop without producing a completion command.
ContinueAsNew(Box<ContinueAsNewWorkflowExecution>)
The workflow requested a new run with the supplied command attributes.
Failed(OutgoingWorkflowError)
The Workflow Execution failed with an error already converted for outbound handling.
Implementations§
Source§impl WorkflowTermination
impl WorkflowTermination
Sourcepub fn cancelled_with_details<T>(details: T) -> Self
pub fn cancelled_with_details<T>(details: T) -> Self
Construct a cancelled workflow termination with details that will be converted using the active payload converter.
Sourcepub fn continue_as_new(can: ContinueAsNewWorkflowExecution) -> Self
pub fn continue_as_new(can: ContinueAsNewWorkflowExecution) -> Self
Constructs a termination that asks the worker to continue the workflow as a new run.
Sourcepub fn failed_application(err: ApplicationFailure) -> Self
pub fn failed_application(err: ApplicationFailure) -> Self
Construct a WorkflowTermination::Failed from an ApplicationFailure.
Trait Implementations§
Source§impl Debug for WorkflowTermination
impl Debug for WorkflowTermination
Source§impl Display for WorkflowTermination
impl Display for WorkflowTermination
Source§impl Error for WorkflowTermination
impl Error for WorkflowTermination
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ActivityExecutionError> for WorkflowTermination
impl From<ActivityExecutionError> for WorkflowTermination
Source§fn from(value: ActivityExecutionError) -> Self
fn from(value: ActivityExecutionError) -> Self
Source§impl From<ApplicationFailure> for WorkflowTermination
impl From<ApplicationFailure> for WorkflowTermination
Source§fn from(value: ApplicationFailure) -> Self
fn from(value: ApplicationFailure) -> Self
Source§impl From<CancelExternalWorkflowError> for WorkflowTermination
impl From<CancelExternalWorkflowError> for WorkflowTermination
Source§fn from(value: CancelExternalWorkflowError) -> Self
fn from(value: CancelExternalWorkflowError) -> Self
Source§impl From<ChildWorkflowExecutionError> for WorkflowTermination
impl From<ChildWorkflowExecutionError> for WorkflowTermination
Source§fn from(value: ChildWorkflowExecutionError) -> Self
fn from(value: ChildWorkflowExecutionError) -> Self
Source§impl From<ChildWorkflowStartError> for WorkflowTermination
impl From<ChildWorkflowStartError> for WorkflowTermination
Source§fn from(value: ChildWorkflowStartError) -> Self
fn from(value: ChildWorkflowStartError) -> Self
Source§impl From<PayloadConversionError> for WorkflowTermination
impl From<PayloadConversionError> for WorkflowTermination
Source§fn from(value: PayloadConversionError) -> Self
fn from(value: PayloadConversionError) -> Self
Source§impl From<WorkflowCancellationError> for WorkflowTermination
impl From<WorkflowCancellationError> for WorkflowTermination
Source§fn from(_value: WorkflowCancellationError) -> Self
fn from(_value: WorkflowCancellationError) -> Self
Source§impl From<WorkflowSignalError> for WorkflowTermination
impl From<WorkflowSignalError> for WorkflowTermination
Source§fn from(value: WorkflowSignalError) -> Self
fn from(value: WorkflowSignalError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for WorkflowTermination
impl !UnwindSafe for WorkflowTermination
impl Freeze for WorkflowTermination
impl Send for WorkflowTermination
impl Sync for WorkflowTermination
impl Unpin for WorkflowTermination
impl UnsafeUnpin for WorkflowTermination
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