#[repr(C)]pub struct OrderBook_API(/* private fields */);
Expand description
C compatible Foreign Function Interface (FFI) for an underlying OrderBook
.
This struct wraps OrderBook
in a way that makes it compatible with C function
calls, enabling interaction with OrderBook
in a C environment.
It implements the Deref
trait, allowing instances of OrderBook_API
to be
dereferenced to OrderBook
, providing access to OrderBook
’s methods without
having to manually access the underlying OrderBook
instance.
Methods from Deref<Target = OrderBook>§
pub fn reset(&mut self)
pub fn add( &mut self, order: BookOrder, flags: u8, sequence: u64, ts_event: UnixNanos, )
pub fn update( &mut self, order: BookOrder, flags: u8, sequence: u64, ts_event: UnixNanos, )
pub fn delete( &mut self, order: BookOrder, flags: u8, sequence: u64, ts_event: UnixNanos, )
pub fn clear(&mut self, sequence: u64, ts_event: UnixNanos)
pub fn clear_bids(&mut self, sequence: u64, ts_event: UnixNanos)
pub fn clear_asks(&mut self, sequence: u64, ts_event: UnixNanos)
pub fn apply_delta(&mut self, delta: &OrderBookDelta)
pub fn apply_deltas(&mut self, deltas: &OrderBookDeltas)
pub fn apply_depth(&mut self, depth: &OrderBookDepth10)
pub fn bids(&self) -> impl Iterator<Item = &Level>
pub fn asks(&self) -> impl Iterator<Item = &Level>
pub fn has_bid(&self) -> bool
pub fn has_ask(&self) -> bool
pub fn best_bid_price(&self) -> Option<Price>
pub fn best_ask_price(&self) -> Option<Price>
pub fn best_bid_size(&self) -> Option<Quantity>
pub fn best_ask_size(&self) -> Option<Quantity>
pub fn spread(&self) -> Option<f64>
pub fn midpoint(&self) -> Option<f64>
pub fn get_avg_px_for_quantity( &self, qty: Quantity, order_side: OrderSide, ) -> f64
pub fn get_avg_px_qty_for_exposure( &self, target_exposure: Quantity, order_side: OrderSide, ) -> (f64, f64, f64)
pub fn get_quantity_for_price(&self, price: Price, order_side: OrderSide) -> f64
pub fn simulate_fills(&self, order: &BookOrder) -> Vec<(Price, Quantity)>
Sourcepub fn pprint(&self, num_levels: usize) -> String
pub fn pprint(&self, num_levels: usize) -> String
Return a String
representation of the order book in a human-readable table format.
pub fn update_quote_tick( &mut self, quote: &QuoteTick, ) -> Result<(), InvalidBookOperation>
pub fn update_trade_tick( &mut self, trade: &TradeTick, ) -> Result<(), InvalidBookOperation>
Trait Implementations§
Source§impl Deref for OrderBook_API
impl Deref for OrderBook_API
Auto Trait Implementations§
impl Freeze for OrderBook_API
impl RefUnwindSafe for OrderBook_API
impl Send for OrderBook_API
impl Sync for OrderBook_API
impl Unpin for OrderBook_API
impl UnwindSafe for OrderBook_API
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