pub struct SimdOrderBook<const N: usize = 64> {
pub symbol: String,
pub exchange_timestamp_ns: u64,
pub system_timestamp_ns: u64,
pub bids: SimdPriceLevels<N>,
pub asks: SimdPriceLevels<N>,
}Expand description
SIMD-aligned order book for high-performance processing with const generic capacity
Fields§
§symbol: StringTrading symbol for the order book (e.g., “BTC-USDT”)
exchange_timestamp_ns: u64Exchange-provided timestamp in nanoseconds
system_timestamp_ns: u64System timestamp in nanoseconds for latency measurement
bids: SimdPriceLevels<N>SIMD-aligned bid levels for high-performance analytics
asks: SimdPriceLevels<N>SIMD-aligned ask levels for high-performance analytics
Implementations§
Source§impl<const N: usize> SimdOrderBook<N>
impl<const N: usize> SimdOrderBook<N>
Sourcepub fn from_orderbook<const M: usize>(book: &OrderBook<M>) -> Self
pub fn from_orderbook<const M: usize>(book: &OrderBook<M>) -> Self
Create from regular OrderBook
Sourcepub fn side_vwap(&self, is_bid: bool, target_volume: f64) -> Option<f64>
pub fn side_vwap(&self, is_bid: bool, target_volume: f64) -> Option<f64>
Calculate volume-weighted average price (VWAP) for a given side
Sourcepub fn bids(&self) -> SmallVec<[PriceLevel; N]>
pub fn bids(&self) -> SmallVec<[PriceLevel; N]>
Get bid levels as PriceLevel slice (compatibility method)
Sourcepub fn asks(&self) -> SmallVec<[PriceLevel; N]>
pub fn asks(&self) -> SmallVec<[PriceLevel; N]>
Get ask levels as PriceLevel slice (compatibility method)
Sourcepub fn apply_snapshot<const M: usize>(&mut self, snapshot: OrderBookSnapshot<M>)
pub fn apply_snapshot<const M: usize>(&mut self, snapshot: OrderBookSnapshot<M>)
Apply a snapshot to the SIMD order book (compatibility method)
Trait Implementations§
Source§impl<const N: usize> Clone for SimdOrderBook<N>
impl<const N: usize> Clone for SimdOrderBook<N>
Source§fn clone(&self) -> SimdOrderBook<N>
fn clone(&self) -> SimdOrderBook<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<const N: usize> Freeze for SimdOrderBook<N>
impl<const N: usize> RefUnwindSafe for SimdOrderBook<N>
impl<const N: usize> Send for SimdOrderBook<N>
impl<const N: usize> Sync for SimdOrderBook<N>
impl<const N: usize> Unpin for SimdOrderBook<N>
impl<const N: usize> UnwindSafe for SimdOrderBook<N>
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