#[repr(align(64))]pub struct Orderbook {
pub code: String,
pub timestamp_ns: u64,
pub local_time_ns: u64,
pub best_ask_price: Decimal,
pub best_bid_price: Decimal,
pub asks: SmallVec<[PriceLevel; 20]>,
pub bids: SmallVec<[PriceLevel; 20]>,
}Expand description
Processed orderbook with additional information
Fields§
§code: StringMarket code (e.g., “KRW-BTC”)
timestamp_ns: u64Timestamp in nanoseconds
local_time_ns: u64Local timestamp when processed (nanoseconds)
best_ask_price: DecimalBest ask price
best_bid_price: DecimalBest bid price
asks: SmallVec<[PriceLevel; 20]>Ask levels (using SmallVec to avoid heap allocations)
bids: SmallVec<[PriceLevel; 20]>Bid levels (using SmallVec to avoid heap allocations)
Implementations§
Source§impl Orderbook
impl Orderbook
Sourcepub fn from_orderbook_message(
msg: &OrderbookMessage,
local_time_ns: u64,
) -> Self
pub fn from_orderbook_message( msg: &OrderbookMessage, local_time_ns: u64, ) -> Self
Create a new orderbook from a raw message
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Orderbook
impl RefUnwindSafe for Orderbook
impl Send for Orderbook
impl Sync for Orderbook
impl Unpin for Orderbook
impl UnwindSafe for Orderbook
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