#[non_exhaustive]pub struct OperationSubType(/* private fields */);Expand description
An operation subtype: 1 to 32 characters from A-Z, a-z, 0-9, -
and _.
Every operation records a subtype in its checkpoint, such as Step or
Callback. Execution history and plugins read it. A step or a
callback can record a custom subtype instead, so the parts of a composed
operation can be told apart. Not calling a builder’s sub_type setter
selects the default subtype. The associated constants hold the subtypes
the SDK records for its own operations.
new validates a value against the rule the service
applies. The service rejects any other subtype, and the execution then
fails. An empty string is rejected too: a caller selects the default by
not calling the setter.
§Examples
use aws_durable_execution_sdk::OperationSubType;
let label = String::from("Payment");
let sub_type = OperationSubType::new(label.as_str())?;
assert_eq!(sub_type.as_str(), "Payment");
assert!(OperationSubType::new("").is_err());
assert_eq!(OperationSubType::MAP_ITERATION.as_str(), "MapIteration");Implementations§
Source§impl OperationSubType
impl OperationSubType
Sourcepub const STEP: OperationSubType
pub const STEP: OperationSubType
Step: a step.
Sourcepub const WAIT: OperationSubType
pub const WAIT: OperationSubType
Wait: a wait.
Sourcepub const CALLBACK: OperationSubType
pub const CALLBACK: OperationSubType
Callback: a callback.
Sourcepub const RUN_IN_CHILD_CONTEXT: OperationSubType
pub const RUN_IN_CHILD_CONTEXT: OperationSubType
RunInChildContext: a child context.
Sourcepub const MAP: OperationSubType
pub const MAP: OperationSubType
Map: the parent of a map.
Sourcepub const MAP_ITERATION: OperationSubType
pub const MAP_ITERATION: OperationSubType
MapIteration: one item of a map.
Sourcepub const PARALLEL: OperationSubType
pub const PARALLEL: OperationSubType
Parallel: the parent of a parallel.
Sourcepub const PARALLEL_BRANCH: OperationSubType
pub const PARALLEL_BRANCH: OperationSubType
ParallelBranch: one branch of a parallel.
Sourcepub const WAIT_FOR_CALLBACK: OperationSubType
pub const WAIT_FOR_CALLBACK: OperationSubType
WaitForCallback: the child context of a wait_for_callback.
Sourcepub const WAIT_FOR_CONDITION: OperationSubType
pub const WAIT_FOR_CONDITION: OperationSubType
WaitForCondition: a wait_for_condition.
Sourcepub const CHAINED_INVOKE: OperationSubType
pub const CHAINED_INVOKE: OperationSubType
ChainedInvoke: an invoke.
Sourcepub fn new(
value: impl Into<String>,
) -> Result<OperationSubType, InvalidOperationSubType>
pub fn new( value: impl Into<String>, ) -> Result<OperationSubType, InvalidOperationSubType>
Validates value against the service rule.
§Errors
Returns InvalidOperationSubType unless value has 1 to 32
bytes and every byte is an ASCII letter, an ASCII digit, - or
_.
Trait Implementations§
Source§impl AsRef<str> for OperationSubType
impl AsRef<str> for OperationSubType
Source§impl Clone for OperationSubType
impl Clone for OperationSubType
Source§impl Debug for OperationSubType
impl Debug for OperationSubType
Source§impl Display for OperationSubType
impl Display for OperationSubType
impl Eq for OperationSubType
Source§impl FromStr for OperationSubType
impl FromStr for OperationSubType
Source§impl Hash for OperationSubType
impl Hash for OperationSubType
Source§impl PartialEq for OperationSubType
impl PartialEq for OperationSubType
impl StructuralPartialEq for OperationSubType
Source§impl TryFrom<&str> for OperationSubType
impl TryFrom<&str> for OperationSubType
Auto Trait Implementations§
impl Forget for OperationSubType
impl Freeze for OperationSubType
impl Move for OperationSubType
impl RefUnwindSafe for OperationSubType
impl Send for OperationSubType
impl Sync for OperationSubType
impl Unpin for OperationSubType
impl UnsafeUnpin for OperationSubType
impl UnwindSafe for OperationSubType
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> 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> 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 more