pub struct Ladder {
pub side: OrderSide,
pub levels: BTreeMap<BookPrice, Level>,
pub cache: HashMap<u64, BookPrice>,
}
Expand description
Represents a ladder of price levels for one side of an order book.
Fields§
§side: OrderSide
§levels: BTreeMap<BookPrice, Level>
§cache: HashMap<u64, BookPrice>
Implementations§
Source§impl Ladder
impl Ladder
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn add_bulk(&mut self, orders: Vec<BookOrder>)
pub fn clear(&mut self)
pub fn add(&mut self, order: BookOrder)
pub fn update(&mut self, order: BookOrder)
pub fn delete(&mut self, order: BookOrder, sequence: u64, ts_event: UnixNanos)
pub fn remove(&mut self, order_id: OrderId, sequence: u64, ts_event: UnixNanos)
pub fn sizes(&self) -> f64
pub fn exposures(&self) -> f64
pub fn top(&self) -> Option<&Level>
pub fn simulate_fills(&self, order: &BookOrder) -> Vec<(Price, Quantity)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ladder
impl RefUnwindSafe for Ladder
impl Send for Ladder
impl Sync for Ladder
impl Unpin for Ladder
impl UnwindSafe for Ladder
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