pub enum CommandFailure {
NotSent(String),
Ambiguous(String),
VenueRejected(String),
}Expand description
Classifies why a state-changing order command failed, by the evidence available.
Adapters keep their own error types and map each submit, modify, or cancel failure to one variant, including the batch and list forms, so the same wire condition classifies identically across venues. A definitive venue acceptance or update is not a failure and carries no variant.
This axis is independent of retryability. Retryability answers whether to send the request again; this answers whether the venue may already have acted on the first attempt. An error can be both, either, or neither.
Variants§
NotSent(String)
A deterministic local failure proves the command was never transmitted.
A terminal rejection event is valid for this evidence.
Ambiguous(String)
The venue outcome is undefined; the command may still have been applied.
A terminal event is never valid for this evidence. Leave the command in flight for a stream update, query, poll, or reconciliation to resolve it either way.
VenueRejected(String)
The venue explicitly declared the command rejected.
A terminal rejection event is valid for this evidence.
Implementations§
Source§impl CommandFailure
impl CommandFailure
Sourcepub fn not_sent(reason: impl Into<String>) -> Self
pub fn not_sent(reason: impl Into<String>) -> Self
Creates a new CommandFailure::NotSent with the given reason.
Sourcepub fn ambiguous(reason: impl Into<String>) -> Self
pub fn ambiguous(reason: impl Into<String>) -> Self
Creates a new CommandFailure::Ambiguous with the given reason.
Sourcepub fn venue_rejected(reason: impl Into<String>) -> Self
pub fn venue_rejected(reason: impl Into<String>) -> Self
Creates a new CommandFailure::VenueRejected with the given reason.
Trait Implementations§
Source§impl Clone for CommandFailure
impl Clone for CommandFailure
Source§fn clone(&self) -> CommandFailure
fn clone(&self) -> CommandFailure
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CommandFailure
impl Debug for CommandFailure
impl Eq for CommandFailure
Source§impl PartialEq for CommandFailure
impl PartialEq for CommandFailure
impl StructuralPartialEq for CommandFailure
Auto Trait Implementations§
impl Freeze for CommandFailure
impl RefUnwindSafe for CommandFailure
impl Send for CommandFailure
impl Sync for CommandFailure
impl Unpin for CommandFailure
impl UnsafeUnpin for CommandFailure
impl UnwindSafe for CommandFailure
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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