[−][src]Struct lobster::OrderBook
An order book that executes orders serially through the execute
method.
Implementations
impl OrderBook
[src]
pub fn new(
arena_capacity: usize,
queue_capacity: usize,
track_stats: bool
) -> Self
[src]
arena_capacity: usize,
queue_capacity: usize,
track_stats: bool
) -> Self
Create an instance representing a single order book.
The arena_capacity
parameter represents the number of orders that will
be pre-allocated.
The queue_capacity
parameter represents the capacity of each vector
storing orders at the same price point.
The track_stats
parameter indicates whether to enable volume and
trades tracking (see last_trade
and traded_volume
).
pub fn min_ask(&self) -> Option<u64>
[src]
Return the lowest ask price, if present.
pub fn max_bid(&self) -> Option<u64>
[src]
Return the highest bid price, if present.
pub fn spread(&self) -> Option<u64>
[src]
Return the difference of the lowest ask and highest bid, if both are present.
pub fn last_trade(&self) -> Option<Trade>
[src]
Return the last trade recorded while stats tracking was active as a
Trade
object, if present.
pub fn traded_volume(&self) -> u64
[src]
Return the total traded volume for all the trades that occurred while the stats tracking was active.
pub fn depth(&self, levels: usize) -> BookDepth
[src]
Return the order book depth as a BookDepth
struct, up to the
specified level. Bids and offers at the same price level are merged in a
single BookLevel
struct.
pub fn track_stats(&mut self, track: bool)
[src]
Toggle the stats tracking on or off, depending on the track
parameter.
pub fn execute(&mut self, event: OrderType) -> OrderEvent
[src]
Execute an order, returning immediately an event indicating the result.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for OrderBook
impl Send for OrderBook
impl Sync for OrderBook
impl Unpin for OrderBook
impl UnwindSafe for OrderBook
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,