pub enum CommandFailure {
InvalidSequenceNumber {
expected_sequence_number: SequenceNumber,
received_sequence_number: SequenceNumber,
},
InvalidTimestamp {
last_seen_timestamp: Timestamp,
received_timestamp: Timestamp,
},
InvalidCommand(CommandError),
OrderNotFound,
}Expand description
Reason for the command execution failure
Variants§
InvalidSequenceNumber
The sequence number of the command is invalid This happens when the command is received out of order
Fields
§
expected_sequence_number: SequenceNumberThe expected sequence number
§
received_sequence_number: SequenceNumberThe received sequence number
InvalidTimestamp
The timestamp of the command is invalid This happens when the command is received before the last seen timestamp
Fields
InvalidCommand(CommandError)
The command is invalid This happens when the command violates the invariants of a command
OrderNotFound
The order was not found in the order book
Trait Implementations§
Source§impl Clone for CommandFailure
impl Clone for CommandFailure
Source§fn clone(&self) -> CommandFailure
fn clone(&self) -> CommandFailure
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandFailure
impl Debug for CommandFailure
Source§impl<'de> Deserialize<'de> for CommandFailure
impl<'de> Deserialize<'de> for CommandFailure
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CommandFailure
impl Display for CommandFailure
Source§impl PartialEq for CommandFailure
impl PartialEq for CommandFailure
Source§impl Serialize for CommandFailure
impl Serialize for CommandFailure
impl Eq 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§
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
Mutably borrows from an owned value. Read more