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 = 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 more