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 0x00..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.
See Publishers.
instrument_id: u32The numeric instrument ID. See Instrument identifiers.
ts_event: u64The matching-engine-received timestamp expressed as the number of nanoseconds since the UNIX epoch.
See ts_event.
Implementations§
Source§impl RecordHeader
impl RecordHeader
Source§impl RecordHeader
impl RecordHeader
Sourcepub const LENGTH_MULTIPLIER: usize = 4
pub const LENGTH_MULTIPLIER: usize = 4
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 Hash for RecordHeader
impl Hash for RecordHeader
Source§impl PartialEq for RecordHeader
impl PartialEq for RecordHeader
Source§impl Serialize for RecordHeader
impl Serialize for RecordHeader
Source§impl WritePyRepr for RecordHeader
Available on crate feature python only.
impl WritePyRepr for RecordHeader
python only.