#[repr(i32)]pub enum SubFlowResetPolicy {
Unspecified = 0,
AlwaysRestart = 1,
AlwaysFail = 2,
AlwaysReject = 3,
AttachElseRestart = 4,
AttachElseFail = 5,
AttachElseReject = 6,
}Expand description
Decides what happens to a SubFlow condition that a restored Step still waits on.
An operation that restores an earlier state of a Flow can restore a Step whose WaitFor waits on SubFlow conditions. Each such condition names the child Flow that its Step started. The policy decides, per condition, whether the restored wait attaches to that child, restarts the child, fails the condition, or rejects the whole operation.
Attaching keeps the condition on its original child. When the child run has ended, its result completes the condition, even if the parent has not received that result yet. When the child run still runs, the condition keeps waiting for it. A child cannot be attached when the parent has no result and the child run it started no longer exists, for example because it was deleted. The ATTACH_ELSE policies then take their second action.
Restarting a child starts it again with the start it originally received: its Flow type, starting Step, input, and options. The child keeps its Flow ID. A still-running run of the child is terminated first. The restored wait then accepts only the restarted run’s result. The original start is read from the child run, so a child whose run no longer exists cannot be restarted, and the operation is rejected. Under ResetFlow, a child that cannot be attached always has no run left, so ATTACH_ELSE_RESTART rejects it too.
Failing a condition terminates the child run when it still runs. The condition then completes with a FAILED child result whose error type is FLOW_ERROR_TYPE_SUB_FLOW_ABANDONED. The Step’s Execute receives it like any failed child.
A restart or a failure is rejected while the child’s start has not reached the child yet; retry the operation later. An attaching policy keeps waiting for such a child instead.
Rejecting fails the operation with FAILED_PRECONDITION. Nothing changes. The error names each Step execution and child Flow ID that caused it.
Variants§
Unspecified = 0
The operation’s default. For ResetFlow it is SUB_FLOW_RESET_POLICY_ATTACH_ELSE_RESTART.
AlwaysRestart = 1
Restarts every child, whether it ended or still runs.
AlwaysFail = 2
Fails every condition, whether its child ended or still runs.
AlwaysReject = 3
Rejects the operation when any restored Step waits on a SubFlow condition.
AttachElseRestart = 4
Attaches each condition to its child. Restarts a child that cannot be attached.
AttachElseFail = 5
Attaches each condition to its child. Fails a condition whose child cannot be attached.
AttachElseReject = 6
Attaches each condition to its child. Rejects the operation when a child cannot be attached.
Implementations§
Source§impl SubFlowResetPolicy
impl SubFlowResetPolicy
Sourcepub const fn is_valid(value: i32) -> bool
pub const fn is_valid(value: i32) -> bool
Returns true if value is a variant of SubFlowResetPolicy.
Sourcepub fn from_i32(value: i32) -> Option<SubFlowResetPolicy>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<SubFlowResetPolicy>
Use the TryFrom<i32> implementation instead
Converts an i32 to a SubFlowResetPolicy, or None if value is not a valid variant.
Source§impl SubFlowResetPolicy
impl SubFlowResetPolicy
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for SubFlowResetPolicy
impl Clone for SubFlowResetPolicy
impl Copy for SubFlowResetPolicy
Source§impl Debug for SubFlowResetPolicy
impl Debug for SubFlowResetPolicy
Source§impl Default for SubFlowResetPolicy
impl Default for SubFlowResetPolicy
Source§fn default() -> SubFlowResetPolicy
fn default() -> SubFlowResetPolicy
impl Eq for SubFlowResetPolicy
Source§impl From<SubFlowResetPolicy> for i32
impl From<SubFlowResetPolicy> for i32
Source§fn from(value: SubFlowResetPolicy) -> i32
fn from(value: SubFlowResetPolicy) -> i32
Source§impl Hash for SubFlowResetPolicy
impl Hash for SubFlowResetPolicy
Source§impl Ord for SubFlowResetPolicy
impl Ord for SubFlowResetPolicy
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SubFlowResetPolicy
impl PartialEq for SubFlowResetPolicy
Source§impl PartialOrd for SubFlowResetPolicy
impl PartialOrd for SubFlowResetPolicy
impl StructuralPartialEq for SubFlowResetPolicy
Source§impl TryFrom<i32> for SubFlowResetPolicy
impl TryFrom<i32> for SubFlowResetPolicy
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(value: i32) -> Result<SubFlowResetPolicy, UnknownEnumValue>
fn try_from(value: i32) -> Result<SubFlowResetPolicy, UnknownEnumValue>
Auto Trait Implementations§
impl Forget for SubFlowResetPolicy
impl Freeze for SubFlowResetPolicy
impl Move for SubFlowResetPolicy
impl RefUnwindSafe for SubFlowResetPolicy
impl Send for SubFlowResetPolicy
impl Sync for SubFlowResetPolicy
impl Unpin for SubFlowResetPolicy
impl UnsafeUnpin for SubFlowResetPolicy
impl UnwindSafe for SubFlowResetPolicy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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