#[repr(C)]pub struct StatMsg {
pub hd: RecordHeader,
pub ts_recv: u64,
pub ts_ref: u64,
pub price: i64,
pub quantity: i32,
pub sequence: u32,
pub ts_in_delta: i32,
pub stat_type: u16,
pub channel_id: u16,
pub update_action: u8,
pub stat_flags: u8,
/* private fields */
}Expand description
A statistics message. A catchall for various data disseminated by publishers.
The stat_type indicates the statistic contained in the message.
Fields§
§hd: RecordHeaderThe common header.
ts_recv: u64The capture-server-received timestamp expressed as the number of nanoseconds since the UNIX epoch.
ts_ref: u64The reference timestamp of the statistic value expressed as the number of
nanoseconds since the UNIX epoch. Will be crate::UNDEF_TIMESTAMP when
unused.
price: i64The value for price statistics expressed as a signed integer where every 1 unit
corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001. Will be
crate::UNDEF_PRICE when unused.
quantity: i32The value for non-price statistics. Will be crate::UNDEF_STAT_QUANTITY when
unused.
sequence: u32The message sequence number assigned at the venue.
ts_in_delta: i32The delta of ts_recv - ts_exchange_send, max 2 seconds.
stat_type: u16The type of statistic value contained in the message. Refer to the
StatType for variants.
channel_id: u16A channel ID within the venue.
update_action: u8Indicates if the statistic is newly added (1) or deleted (2). (Deleted is only used with some stat types)
stat_flags: u8Additional flags associate with certain stat types.
Implementations§
source§impl StatMsg
impl StatMsg
sourcepub fn ts_recv(&self) -> Option<OffsetDateTime>
pub fn ts_recv(&self) -> Option<OffsetDateTime>
Parses the raw capture-server-received timestamp into a datetime. Returns None
if ts_recv contains the sentinel for a null timestamp.
sourcepub fn ts_ref(&self) -> Option<OffsetDateTime>
pub fn ts_ref(&self) -> Option<OffsetDateTime>
Parses the raw reference timestamp of the statistic value into a datetime.
Returns None if ts_ref contains the sentinel for a null timestamp.
sourcepub fn update_action(&self) -> Result<StatUpdateAction>
pub fn update_action(&self) -> Result<StatUpdateAction>
Tries to convert the raw update_action to an enum.
§Errors
This function returns an error if the update_action field does not
contain a valid StatUpdateAction.
sourcepub fn ts_in_delta(&self) -> Duration
pub fn ts_in_delta(&self) -> Duration
Parses the raw ts_in_delta—the delta of ts_recv - ts_exchange_send—into a duration.
Trait Implementations§
source§impl<'de> Deserialize<'de> for StatMsg
impl<'de> Deserialize<'de> for StatMsg
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<'a> From<&'a StatMsg> for RecordRefEnum<'a>
impl<'a> From<&'a StatMsg> for RecordRefEnum<'a>
source§impl From<StatMsg> for RecordEnum
impl From<StatMsg> for RecordEnum
source§impl HasPyGilRef for StatMsg
impl HasPyGilRef for StatMsg
§type AsRefTarget = PyCell<StatMsg>
type AsRefTarget = PyCell<StatMsg>
source§impl PartialEq for StatMsg
impl PartialEq for StatMsg
source§impl PartialOrd for StatMsg
impl PartialOrd for StatMsg
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl PyClassImpl for StatMsg
impl PyClassImpl for StatMsg
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
§type ThreadChecker = SendablePyClass<StatMsg>
type ThreadChecker = SendablePyClass<StatMsg>
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn dict_offset() -> Option<Py_ssize_t>
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn weaklist_offset() -> Option<isize>
source§impl PyClassNewTextSignature<StatMsg> for PyClassImplCollector<StatMsg>
Available on crate feature python only.
impl PyClassNewTextSignature<StatMsg> for PyClassImplCollector<StatMsg>
python only.fn new_text_signature(self) -> Option<&'static str>
source§impl PyMethods<StatMsg> for PyClassImplCollector<StatMsg>
Available on crate feature python only.
impl PyMethods<StatMsg> for PyClassImplCollector<StatMsg>
python only.fn py_methods(self) -> &'static PyClassItems
source§impl PyTypeInfo for StatMsg
impl PyTypeInfo for StatMsg
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
PyTypeInfo::type_object will be replaced by PyTypeInfo::type_object_bound in a future PyO3 versionsource§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
PyTypeInfo::is_type_of will be replaced by PyTypeInfo::is_type_of_bound in a future PyO3 versionobject is an instance of this type or a subclass of this type.source§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.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
PyTypeInfo::is_exact_type_of will be replaced by PyTypeInfo::is_exact_type_of_bound in a future PyO3 versionobject is an instance of this type.source§impl Record for StatMsg
impl Record for StatMsg
source§fn header(&self) -> &RecordHeader
fn header(&self) -> &RecordHeader
RecordHeader that comes at the beginning of all
record types.source§fn raw_index_ts(&self) -> u64
fn raw_index_ts(&self) -> u64
source§fn record_size(&self) -> usize
fn record_size(&self) -> usize
source§fn rtype(&self) -> Result<RType>
fn rtype(&self) -> Result<RType>
source§fn publisher(&self) -> Result<Publisher>
fn publisher(&self) -> Result<Publisher>
publisher_id into an enum which is useful for
exhaustive pattern matching. Read moresource§fn index_ts(&self) -> Option<OffsetDateTime>
fn index_ts(&self) -> Option<OffsetDateTime>
None if the primary
timestamp contains the sentinel value for a null timestamp. Read moresource§fn index_date(&self) -> Option<Date>
fn index_date(&self) -> Option<Date>
index_ts()). Returns None if the primary timestamp contains the
sentinel value for a null timestamp.source§impl RecordMut for StatMsg
impl RecordMut for StatMsg
source§fn header_mut(&mut self) -> &mut RecordHeader
fn header_mut(&mut self) -> &mut RecordHeader
RecordHeader that comes at the beginning of
all record types.