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() -> WorkflowTermination
pub fn cancelled() -> WorkflowTermination
Construct a cancelled workflow termination without details.
Sourcepub fn cancelled_with_details<T>(details: T) -> WorkflowTermination
pub fn cancelled_with_details<T>(details: T) -> WorkflowTermination
Construct a cancelled workflow termination with details that will be converted using the active payload converter.
Sourcepub fn continue_as_new(
can: ContinueAsNewWorkflowExecution,
) -> WorkflowTermination
pub fn continue_as_new( can: ContinueAsNewWorkflowExecution, ) -> WorkflowTermination
Constructs a termination that asks the worker to continue the workflow as a new run.
Sourcepub fn failed_application(err: ApplicationFailure) -> WorkflowTermination
pub fn failed_application(err: ApplicationFailure) -> WorkflowTermination
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) -> WorkflowTermination
fn from(value: ActivityExecutionError) -> WorkflowTermination
Source§impl From<ApplicationFailure> for WorkflowTermination
impl From<ApplicationFailure> for WorkflowTermination
Source§fn from(value: ApplicationFailure) -> WorkflowTermination
fn from(value: ApplicationFailure) -> WorkflowTermination
Source§impl From<CancelExternalWorkflowError> for WorkflowTermination
impl From<CancelExternalWorkflowError> for WorkflowTermination
Source§fn from(value: CancelExternalWorkflowError) -> WorkflowTermination
fn from(value: CancelExternalWorkflowError) -> WorkflowTermination
Source§impl From<ChildWorkflowExecutionError> for WorkflowTermination
impl From<ChildWorkflowExecutionError> for WorkflowTermination
Source§fn from(value: ChildWorkflowExecutionError) -> WorkflowTermination
fn from(value: ChildWorkflowExecutionError) -> WorkflowTermination
Source§impl From<ChildWorkflowStartError> for WorkflowTermination
impl From<ChildWorkflowStartError> for WorkflowTermination
Source§fn from(value: ChildWorkflowStartError) -> WorkflowTermination
fn from(value: ChildWorkflowStartError) -> WorkflowTermination
Source§impl From<PayloadConversionError> for WorkflowTermination
impl From<PayloadConversionError> for WorkflowTermination
Source§fn from(value: PayloadConversionError) -> WorkflowTermination
fn from(value: PayloadConversionError) -> WorkflowTermination
Source§impl From<WorkflowCancellationError> for WorkflowTermination
impl From<WorkflowCancellationError> for WorkflowTermination
Source§fn from(_value: WorkflowCancellationError) -> WorkflowTermination
fn from(_value: WorkflowCancellationError) -> WorkflowTermination
Source§impl From<WorkflowSignalError> for WorkflowTermination
impl From<WorkflowSignalError> for WorkflowTermination
Source§fn from(value: WorkflowSignalError) -> WorkflowTermination
fn from(value: WorkflowSignalError) -> WorkflowTermination
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> 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