#[repr(C)]pub struct BookLevel_API(/* private fields */);
Expand description
C compatible Foreign Function Interface (FFI) for an underlying order book[Level
].
This struct wraps Level
in a way that makes it compatible with C function
calls, enabling interaction with Level
in a C environment.
It implements the Deref
trait, allowing instances of Level_API
to be
dereferenced to Level
, providing access to Level
’s methods without
having to manually acce wss the underlying Level
instance.
Implementations§
Source§impl BookLevel_API
impl BookLevel_API
Sourcepub fn new(level: BookLevel) -> Self
pub fn new(level: BookLevel) -> Self
Creates a new BookLevel_API
instance.
Methods from Deref<Target = BookLevel>§
Sourcepub fn first(&self) -> Option<&BookOrder>
pub fn first(&self) -> Option<&BookOrder>
Returns a reference to the first order at this price level in FIFO order.
Sourcepub fn get_orders(&self) -> Vec<BookOrder>
pub fn get_orders(&self) -> Vec<BookOrder>
Returns all orders at this price level in FIFO insertion order.
Sourcepub fn size_raw(&self) -> u64
pub fn size_raw(&self) -> u64
Returns the total size of all orders at this price level as raw integer units.
Sourcepub fn size_decimal(&self) -> Decimal
pub fn size_decimal(&self) -> Decimal
Returns the total size of all orders at this price level as a decimal.
Sourcepub fn exposure(&self) -> f64
pub fn exposure(&self) -> f64
Returns the total exposure (price * size) of all orders at this price level as a float.
Sourcepub fn exposure_raw(&self) -> u64
pub fn exposure_raw(&self) -> u64
Returns the total exposure (price * size) of all orders at this price level as raw integer units.
Sourcepub fn add_bulk(&mut self, orders: Vec<BookOrder>)
pub fn add_bulk(&mut self, orders: Vec<BookOrder>)
Adds multiple orders to this price level in FIFO order. Orders must match the level’s price.
Sourcepub fn add(&mut self, order: BookOrder)
pub fn add(&mut self, order: BookOrder)
Adds an order to this price level. Order must match the level’s price.
Sourcepub fn update(&mut self, order: BookOrder)
pub fn update(&mut self, order: BookOrder)
Updates an existing order at this price level. Updated order must match the level’s price. Removes the order if size becomes zero.
Sourcepub fn remove_by_id(
&mut self,
order_id: OrderId,
sequence: u64,
ts_event: UnixNanos,
)
pub fn remove_by_id( &mut self, order_id: OrderId, sequence: u64, ts_event: UnixNanos, )
Removes an order by its ID. Panics if the order doesn’t exist.
Trait Implementations§
Source§impl Clone for BookLevel_API
impl Clone for BookLevel_API
Source§fn clone(&self) -> BookLevel_API
fn clone(&self) -> BookLevel_API
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more