#[repr(C)]pub struct OrderBookDelta {
pub instrument_id: InstrumentId,
pub action: BookAction,
pub order: BookOrder,
pub flags: u8,
pub sequence: u64,
pub ts_event: UnixNanos,
pub ts_init: UnixNanos,
}Expand description
Represents a single change/delta in an order book.
Fields§
§instrument_id: InstrumentIdThe instrument ID for the book.
action: BookActionThe order book delta action.
order: BookOrderThe order to apply.
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 OrderBookDelta
impl OrderBookDelta
Sourcepub fn new_checked(
instrument_id: InstrumentId,
action: BookAction,
order: BookOrder,
flags: u8,
sequence: u64,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Result<Self>
pub fn new_checked( instrument_id: InstrumentId, action: BookAction, order: BookOrder, flags: u8, sequence: u64, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Result<Self>
Creates a new OrderBookDelta instance with correctness checking.
§Errors
Returns an error if action is BookAction::Add or BookAction::Update and size is not positive (> 0).
§Notes
PyO3 requires a Result type for proper error handling and stacktrace printing in Python.
Sourcepub fn new(
instrument_id: InstrumentId,
action: BookAction,
order: BookOrder,
flags: u8,
sequence: u64,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Self
pub fn new( instrument_id: InstrumentId, action: BookAction, order: BookOrder, flags: u8, sequence: u64, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Self
Creates a new OrderBookDelta instance.
§Panics
Panics if action is BookAction::Add or BookAction::Update and size is not positive (> 0).
Sourcepub fn clear(
instrument_id: InstrumentId,
sequence: u64,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Self
pub fn clear( instrument_id: InstrumentId, sequence: u64, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Self
Creates a new OrderBookDelta instance with a Clear action and NULL order.
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 OrderBookDelta
impl CatalogPathPrefix for OrderBookDelta
Source§fn path_prefix() -> &'static str
fn path_prefix() -> &'static str
Source§impl Clone for OrderBookDelta
impl Clone for OrderBookDelta
Source§fn clone(&self) -> OrderBookDelta
fn clone(&self) -> OrderBookDelta
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 OrderBookDelta
Source§impl Debug for OrderBookDelta
impl Debug for OrderBookDelta
Source§impl<'de> Deserialize<'de> for OrderBookDelta
impl<'de> Deserialize<'de> for OrderBookDelta
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 OrderBookDelta
impl Display for OrderBookDelta
impl Eq for OrderBookDelta
Source§impl From<OrderBookDelta> for Data
impl From<OrderBookDelta> for Data
Source§fn from(value: OrderBookDelta) -> Self
fn from(value: OrderBookDelta) -> Self
Source§impl HasTsInit for OrderBookDelta
impl HasTsInit for OrderBookDelta
Source§impl Hash for OrderBookDelta
impl Hash for OrderBookDelta
Source§impl PartialEq for OrderBookDelta
impl PartialEq for OrderBookDelta
Source§fn eq(&self, other: &OrderBookDelta) -> bool
fn eq(&self, other: &OrderBookDelta) -> bool
self and other values to be equal, and is used by ==.Source§impl Serializable for OrderBookDelta
impl Serializable for OrderBookDelta
Source§impl Serialize for OrderBookDelta
impl Serialize for OrderBookDelta
impl StructuralPartialEq for OrderBookDelta
Auto Trait Implementations§
impl Freeze for OrderBookDelta
impl RefUnwindSafe for OrderBookDelta
impl Send for OrderBookDelta
impl Sync for OrderBookDelta
impl Unpin for OrderBookDelta
impl UnsafeUnpin for OrderBookDelta
impl UnwindSafe for OrderBookDelta
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.