pub enum OrderBookError {
PriceLevelError(PriceLevelError),
OrderNotFound(String),
InvalidPriceLevel(u64),
PriceCrossing {
price: u64,
side: Side,
opposite_price: u64,
},
InsufficientLiquidity {
side: Side,
requested: u64,
available: u64,
},
InvalidOperation {
message: String,
},
}Expand description
Errors that can occur within the OrderBook
Variants§
PriceLevelError(PriceLevelError)
Error from underlying price level operations
OrderNotFound(String)
Order not found in the book
InvalidPriceLevel(u64)
Invalid price level
PriceCrossing
Price crossing (bid >= ask)
Fields
InsufficientLiquidity
Insufficient liquidity for market order
Fields
InvalidOperation
Operation not permitted for specified order type
Trait Implementations§
Source§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 From<PriceLevelError> for OrderBookError
impl From<PriceLevelError> for OrderBookError
Source§fn from(err: PriceLevelError) -> Self
fn from(err: PriceLevelError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OrderBookError
impl RefUnwindSafe for OrderBookError
impl Send for OrderBookError
impl Sync for OrderBookError
impl Unpin 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