Struct dbn::record::RecordHeader
source · #[repr(C)]pub struct RecordHeader {
pub rtype: u8,
pub publisher_id: u16,
pub instrument_id: u32,
pub ts_event: u64,
/* private fields */
}Expand description
Common data for all Databento records. Always found at the beginning of a record struct.
Fields§
§rtype: u8The record type; with 0xe0..0x0F specifying MBP levels size. Record types
implement the trait HasRType, and the has_rtype
function can be used to check if that type can be used to decode a message with
a given rtype. The set of possible values is defined in rtype.
publisher_id: u16The publisher ID assigned by Databento, which denotes the dataset and venue.
instrument_id: u32The numeric ID assigned to the instrument.
ts_event: u64The matching-engine-received timestamp expressed as number of nanoseconds since the UNIX epoch.
Implementations§
source§impl RecordHeader
impl RecordHeader
source§impl RecordHeader
impl RecordHeader
sourcepub const LENGTH_MULTIPLIER: usize = 4usize
pub const LENGTH_MULTIPLIER: usize = 4usize
The multiplier for converting the length field to the number of bytes.
sourcepub const fn new<R: HasRType>(
rtype: u8,
publisher_id: u16,
instrument_id: u32,
ts_event: u64
) -> Self
pub const fn new<R: HasRType>( rtype: u8, publisher_id: u16, instrument_id: u32, ts_event: u64 ) -> Self
Creates a new RecordHeader. R and rtype should be compatible.
sourcepub const fn record_size(&self) -> usize
pub const fn record_size(&self) -> usize
Returns the size of the entire record in bytes. The size of a RecordHeader
is constant.
sourcepub fn ts_event(&self) -> Option<OffsetDateTime>
pub fn ts_event(&self) -> Option<OffsetDateTime>
Parses the raw matching-engine-received timestamp into a datetime. Returns
None if ts_event contains the sentinel for a null timestamp.
Trait Implementations§
source§impl Clone for RecordHeader
impl Clone for RecordHeader
source§fn clone(&self) -> RecordHeader
fn clone(&self) -> RecordHeader
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for RecordHeader
impl Debug for RecordHeader
source§impl<'de> Deserialize<'de> for RecordHeader
impl<'de> Deserialize<'de> for RecordHeader
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 HasPyGilRef for RecordHeader
impl HasPyGilRef for RecordHeader
§type AsRefTarget = PyCell<RecordHeader>
type AsRefTarget = PyCell<RecordHeader>
source§impl Hash for RecordHeader
impl Hash for RecordHeader
source§impl PartialEq for RecordHeader
impl PartialEq for RecordHeader
source§fn eq(&self, other: &RecordHeader) -> bool
fn eq(&self, other: &RecordHeader) -> bool
self and other values to be equal, and is used
by ==.source§impl PyClassImpl for RecordHeader
impl PyClassImpl for RecordHeader
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<RecordHeader>
type ThreadChecker = SendablePyClass<RecordHeader>
§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<'a, 'py> PyFunctionArgument<'a, 'py> for &'a RecordHeader
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a RecordHeader
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut RecordHeader
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut RecordHeader
source§impl PyTypeInfo for RecordHeader
impl PyTypeInfo for RecordHeader
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.