#[repr(C)]pub struct OrderBookDepth10 {
pub instrument_id: InstrumentId,
pub bids: [BookOrder; 10],
pub asks: [BookOrder; 10],
pub bid_counts: [u32; 10],
pub ask_counts: [u32; 10],
pub flags: u8,
pub sequence: u64,
pub ts_event: UnixNanos,
pub ts_init: UnixNanos,
}Expand description
Represents an aggregated order book update with a fixed depth of 10 levels per side.
This structure is specifically designed for scenarios where a snapshot of the top 10 bid and
ask levels in an order book is needed. It differs from OrderBookDelta or OrderBookDeltas
in its fixed-depth nature and is optimized for cases where a full depth representation is not
required or practical.
Note: This type is not compatible with OrderBookDelta or OrderBookDeltas due to
its specialized structure and limited depth use case.
Fields§
§instrument_id: InstrumentIdThe instrument ID for the book.
bids: [BookOrder; 10]The bid orders for the depth update.
asks: [BookOrder; 10]The ask orders for the depth update.
bid_counts: [u32; 10]The count of bid orders per level for the depth update.
ask_counts: [u32; 10]The count of ask orders per level for the depth update.
flags: u8The record flags bit field, indicating event end and data information.
sequence: u64The message sequence number assigned at the venue.
ts_event: UnixNanosUNIX timestamp (nanoseconds) when the book event occurred.
ts_init: UnixNanosUNIX timestamp (nanoseconds) when the instance was created.
Implementations§
Source§impl OrderBookDepth10
impl OrderBookDepth10
Sourcepub fn new(
instrument_id: InstrumentId,
bids: [BookOrder; 10],
asks: [BookOrder; 10],
bid_counts: [u32; 10],
ask_counts: [u32; 10],
flags: u8,
sequence: u64,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Self
pub fn new( instrument_id: InstrumentId, bids: [BookOrder; 10], asks: [BookOrder; 10], bid_counts: [u32; 10], ask_counts: [u32; 10], flags: u8, sequence: u64, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Self
Creates a new OrderBookDepth10 instance.
Sourcepub fn get_metadata(
instrument_id: &InstrumentId,
price_precision: u8,
size_precision: u8,
) -> HashMap<String, String>
pub fn get_metadata( instrument_id: &InstrumentId, price_precision: u8, size_precision: u8, ) -> HashMap<String, String>
Returns the metadata for the type, for use with serialization formats.
Sourcepub fn get_fields() -> IndexMap<String, String>
pub fn get_fields() -> IndexMap<String, String>
Returns the field map for the type, for use with Arrow schemas.
Trait Implementations§
Source§impl CatalogPathPrefix for OrderBookDepth10
impl CatalogPathPrefix for OrderBookDepth10
Source§fn path_prefix() -> &'static str
fn path_prefix() -> &'static str
Source§impl Clone for OrderBookDepth10
impl Clone for OrderBookDepth10
Source§fn clone(&self) -> OrderBookDepth10
fn clone(&self) -> OrderBookDepth10
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OrderBookDepth10
Source§impl Debug for OrderBookDepth10
impl Debug for OrderBookDepth10
Source§impl<'de> Deserialize<'de> for OrderBookDepth10
impl<'de> Deserialize<'de> for OrderBookDepth10
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for OrderBookDepth10
impl Display for OrderBookDepth10
impl Eq for OrderBookDepth10
Source§impl From<OrderBookDepth10> for Data
impl From<OrderBookDepth10> for Data
Source§fn from(value: OrderBookDepth10) -> Self
fn from(value: OrderBookDepth10) -> Self
Source§impl HasTsInit for OrderBookDepth10
impl HasTsInit for OrderBookDepth10
Source§impl Hash for OrderBookDepth10
impl Hash for OrderBookDepth10
Source§impl PartialEq for OrderBookDepth10
impl PartialEq for OrderBookDepth10
Source§fn eq(&self, other: &OrderBookDepth10) -> bool
fn eq(&self, other: &OrderBookDepth10) -> bool
self and other values to be equal, and is used by ==.Source§impl Serializable for OrderBookDepth10
impl Serializable for OrderBookDepth10
Source§impl Serialize for OrderBookDepth10
impl Serialize for OrderBookDepth10
impl StructuralPartialEq for OrderBookDepth10
Auto Trait Implementations§
impl Freeze for OrderBookDepth10
impl RefUnwindSafe for OrderBookDepth10
impl Send for OrderBookDepth10
impl Sync for OrderBookDepth10
impl Unpin for OrderBookDepth10
impl UnsafeUnpin for OrderBookDepth10
impl UnwindSafe for OrderBookDepth10
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.