#[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 a 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: InstrumentId
The 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: u8
The record flags bit field, indicating event end and data information.
sequence: u64
The message sequence number assigned at the venue.
ts_event: UnixNanos
UNIX timestamp (nanoseconds) when the book event occurred.
ts_init: UnixNanos
UNIX timestamp (nanoseconds) when the struct was initialized.
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 Clone for OrderBookDepth10
impl Clone for OrderBookDepth10
Source§fn clone(&self) -> OrderBookDepth10
fn clone(&self) -> OrderBookDepth10
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§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
Source§impl From<OrderBookDepth10> for Data
impl From<OrderBookDepth10> for Data
Source§fn from(value: OrderBookDepth10) -> Self
fn from(value: OrderBookDepth10) -> Self
Source§impl Hash for OrderBookDepth10
impl Hash for OrderBookDepth10
Source§impl IntoPy<Py<PyAny>> for OrderBookDepth10
impl IntoPy<Py<PyAny>> for OrderBookDepth10
Source§impl PartialEq for OrderBookDepth10
impl PartialEq for OrderBookDepth10
Source§impl PyClass for OrderBookDepth10
impl PyClass for OrderBookDepth10
Source§impl PyClassImpl for OrderBookDepth10
impl PyClassImpl for OrderBookDepth10
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§type ThreadChecker = SendablePyClass<OrderBookDepth10>
type ThreadChecker = SendablePyClass<OrderBookDepth10>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<OrderBookDepth10> for PyClassImplCollector<OrderBookDepth10>
impl PyClassNewTextSignature<OrderBookDepth10> for PyClassImplCollector<OrderBookDepth10>
fn new_text_signature(self) -> Option<&'static str>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a OrderBookDepth10
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a OrderBookDepth10
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut OrderBookDepth10
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut OrderBookDepth10
Source§impl PyMethods<OrderBookDepth10> for PyClassImplCollector<OrderBookDepth10>
impl PyMethods<OrderBookDepth10> for PyClassImplCollector<OrderBookDepth10>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for OrderBookDepth10
impl PyTypeInfo for OrderBookDepth10
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type.Source§impl Serializable for OrderBookDepth10
impl Serializable for OrderBookDepth10
Source§fn from_json_bytes(data: &[u8]) -> Result<Self, Error>
fn from_json_bytes(data: &[u8]) -> Result<Self, Error>
Source§fn from_msgpack_bytes(data: &[u8]) -> Result<Self, Error>
fn from_msgpack_bytes(data: &[u8]) -> Result<Self, Error>
MsgPack
encoded bytes.Source§fn as_json_bytes(&self) -> Result<Bytes, Error>
fn as_json_bytes(&self) -> Result<Bytes, Error>
Source§fn as_msgpack_bytes(&self) -> Result<Bytes, Error>
fn as_msgpack_bytes(&self) -> Result<Bytes, Error>
MsgPack
encoded bytes.Source§impl Serialize for OrderBookDepth10
impl Serialize for OrderBookDepth10
impl Copy for OrderBookDepth10
impl DerefToPyAny for OrderBookDepth10
impl Eq 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 UnwindSafe for OrderBookDepth10
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
§fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
§fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§impl<T> Separable for Twhere
T: Display,
impl<T> Separable for Twhere
T: Display,
Source§fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
SeparatorPolicy
. Read more