pub struct OrderQueue { /* private fields */ }Expand description
The per-order book, including queue order. Snapshot and event methods on Sink maintain it;
Chart::order_queue reads it. At most 10,000 orders per side, with bounded resync buffering.
Implementations§
Source§impl OrderQueue
impl OrderQueue
Sourcepub fn new(tick_size: Option<f64>) -> Self
pub fn new(tick_size: Option<f64>) -> Self
An empty book, keying prices by the instrument’s positive finite tick size when known.
Sourcepub fn sequence(&self) -> Option<u64>
pub fn sequence(&self) -> Option<u64>
Last applied sequence, or None until a usable snapshot or after a gap.
Sourcepub fn orders(&self) -> impl Iterator<Item = &RestingOrder>
pub fn orders(&self) -> impl Iterator<Item = &RestingOrder>
All held orders, in queue priority order. A lost book contains none.
Sourcepub fn queue(
&self,
side: OrderSide,
price: f64,
) -> impl Iterator<Item = &RestingOrder>
pub fn queue( &self, side: OrderSide, price: f64, ) -> impl Iterator<Item = &RestingOrder>
Orders at price, first in queue first. Prices share the aggregated book’s tick rounding.
Sourcepub fn largest_order(
&self,
side: OrderSide,
price: f64,
) -> Option<&RestingOrder>
pub fn largest_order( &self, side: OrderSide, price: f64, ) -> Option<&RestingOrder>
Largest resting order at a price, if any. Ties keep the earliest queue priority.
Sourcepub fn take_executions(&mut self) -> Vec<Tick>
pub fn take_executions(&mut self) -> Vec<Tick>
Trades produced by accepted executions, drained once. Each fill names its resting order. At most 10,000 pending fills; the oldest make room if the host does not drain them.
Sourcepub fn aggregate(
&self,
symbol: impl Into<String>,
minimum_size: f64,
) -> OrderBook
pub fn aggregate( &self, symbol: impl Into<String>, minimum_size: f64, ) -> OrderBook
Aggregated levels for ladders and heatmaps, counting only orders at least minimum_size.
Invalid thresholds return an empty book. Counts and totals refer to the selected orders.
Sourcepub fn filtered(
&self,
symbol: impl Into<String>,
filter: &OrderFilter,
) -> Result<OrderBook, OrderFilterUnavailable>
pub fn filtered( &self, symbol: impl Into<String>, filter: &OrderFilter, ) -> Result<OrderBook, OrderFilterUnavailable>
The levels of the orders filter accepts, as the book stood at its last update: what a
ladder, heatmap and book size study built on the same filter show. Fails when the held
orders carry none of the metadata a filter field needs, rather than showing the unfiltered
book as if it were filtered. An empty book is never unavailable.
Sourcepub fn largest_orders(&self, filter: &OrderFilter) -> Vec<&RestingOrder>
pub fn largest_orders(&self, filter: &OrderFilter) -> Vec<&RestingOrder>
The largest order filter accepts at each price of each side, bids from the highest
price down and then asks from the lowest up. Ties keep the earliest queue priority.
Trait Implementations§
Source§impl Clone for OrderQueue
impl Clone for OrderQueue
Source§fn clone(&self) -> OrderQueue
fn clone(&self) -> OrderQueue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for OrderQueue
impl RefUnwindSafe for OrderQueue
impl Send for OrderQueue
impl Sync for OrderQueue
impl Unpin for OrderQueue
impl UnsafeUnpin for OrderQueue
impl UnwindSafe for OrderQueue
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
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,
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