pub enum OrderBookError {
OrderAlreadyExists {
order_id: OrderId,
existing_price: UD64,
},
OrderNotFound {
order_id: OrderId,
},
OrderNotAtExpectedLevel {
order_id: OrderId,
expected_price: UD64,
side: OrderSide,
},
OrderIdMismatch {
expected: OrderId,
actual: OrderId,
},
InvalidOrderSize {
order_id: OrderId,
size: UD64,
},
InvalidOrderPrice {
order_id: OrderId,
price: UD64,
},
LevelNotFound {
price: UD64,
side: OrderSide,
},
DanglingOrderReference {
order_id: OrderId,
referenced_id: OrderId,
pointer: &'static str,
},
}Expand description
Error type for order book operations.
Variants§
OrderAlreadyExists
Attempted to add an order that already exists in the book.
OrderNotFound
Attempted to update or remove an order that doesn’t exist.
OrderNotAtExpectedLevel
Order exists in index but not found at the expected price level. This indicates internal inconsistency.
OrderIdMismatch
Attempted to update an order but the new order has a different ID.
InvalidOrderSize
Order has zero or negative size.
InvalidOrderPrice
Order has zero price.
LevelNotFound
Expected price level not found. This indicates internal inconsistency.
DanglingOrderReference
Order references another order that doesn’t exist in the snapshot. This indicates data inconsistency.
Trait Implementations§
Source§impl Clone for OrderBookError
impl Clone for OrderBookError
Source§fn clone(&self) -> OrderBookError
fn clone(&self) -> OrderBookError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OrderBookError
impl Debug for OrderBookError
Source§impl Display for OrderBookError
impl Display for OrderBookError
Source§impl Error for OrderBookError
impl Error for OrderBookError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for OrderBookError
impl PartialEq for OrderBookError
impl StructuralPartialEq for OrderBookError
Auto Trait Implementations§
impl Freeze for OrderBookError
impl RefUnwindSafe for OrderBookError
impl Send for OrderBookError
impl Sync for OrderBookError
impl Unpin for OrderBookError
impl UnsafeUnpin for OrderBookError
impl UnwindSafe for OrderBookError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.