pub struct StepDecision { /* private fields */ }Expand description
Describes the durable outcome of one successful Step execution.
A decision moves to one or more Steps, completes or fails the Flow, waits for Channels to empty, or deliberately leaves the Flow at a dead end.
Implementations§
Source§impl StepDecision
impl StepDecision
Sourcepub fn go_to<TargetStep>(step: &TargetStep, input: TargetStep::Input) -> Selfwhere
TargetStep: Step,
pub fn go_to<TargetStep>(step: &TargetStep, input: TargetStep::Input) -> Selfwhere
TargetStep: Step,
Moves to one typed target Step.
Sourcepub fn go_to_many(movements: impl IntoIterator<Item = StepMovement>) -> Self
pub fn go_to_many(movements: impl IntoIterator<Item = StepMovement>) -> Self
Moves to all targets, enabling concurrent active Steps.
Sourcepub fn graceful_complete<Output: Value>(output: Output) -> Self
pub fn graceful_complete<Output: Value>(output: Output) -> Self
Completes only after all other active Steps finish, returning output.
Sourcepub fn force_complete<Output: Value>(output: Output) -> Self
pub fn force_complete<Output: Value>(output: Output) -> Self
Completes immediately, abandoning other active Steps and returning output.
Sourcepub fn force_complete_if_channels_empty<Output: Value>(
output: Output,
fallback: StepMovement,
channels: impl IntoIterator<Item = ChannelGuard>,
) -> Self
pub fn force_complete_if_channels_empty<Output: Value>( output: Output, fallback: StepMovement, channels: impl IntoIterator<Item = ChannelGuard>, ) -> Self
Completes with output when every guard is empty; otherwise follows fallback.
Sourcepub fn force_fail(reason: impl Into<String>) -> Self
pub fn force_fail(reason: impl Into<String>) -> Self
Fails the Flow immediately with an application-provided reason.
Sourcepub fn dead_end() -> Self
pub fn dead_end() -> Self
Leaves the Flow running with no next Step.
Use this only when an RPC or external operation will resume the Flow later.
Sourcepub fn cancel_step<SelectedStep>(self, step: &SelectedStep) -> Selfwhere
SelectedStep: Step,
pub fn cancel_step<SelectedStep>(self, step: &SelectedStep) -> Selfwhere
SelectedStep: Step,
Selects every queued or active execution of one registered Step type.
Dex resolves one snapshot after the current execute succeeds. Finished,
already-canceled, and absent executions are no-ops. Steps scheduled by this decision
are excluded. Call repeatedly to select multiple types; Flow-wide selection wins.
Sourcepub fn cancel_sibling_step<SelectedStep>(self, step: &SelectedStep) -> Selfwhere
SelectedStep: Step,
pub fn cancel_sibling_step<SelectedStep>(self, step: &SelectedStep) -> Selfwhere
SelectedStep: Step,
Selects same-source executions of one registered Step type.
A sibling has the same Context::from_step_execution_id
as the execution returning this decision. Snapshot and no-op behavior match
Self::cancel_step. Call repeatedly to select multiple Step types.
Auto Trait Implementations§
impl !RefUnwindSafe for StepDecision
impl !UnwindSafe for StepDecision
impl Freeze for StepDecision
impl Send for StepDecision
impl Sync for StepDecision
impl Unpin for StepDecision
impl UnsafeUnpin for StepDecision
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