pub enum RecordHeader {
Definition {
local_mesg_num: u8,
has_dev_data: bool,
},
Data {
local_mesg_num: u8,
},
CompressedTimestamp {
local_mesg_num: u8,
timestamp_offset: u8,
},
}Expand description
Classification of a single record-header byte.
Variants§
Definition
Definition message — declares the schema for one of the 16 local slots.
Fields
Data
Data message — payload follows, parsed against the Definition stored
in local_mesg_num’s slot.
CompressedTimestamp
Compressed-timestamp data message. Bit 7 = 1; only 2 bits available
for local_mesg_num, 5 bits for the timestamp delta against the most
recent full timestamp seen.
Implementations§
Source§impl RecordHeader
impl RecordHeader
Sourcepub const COMPRESSED_TIMESTAMP_MASK: u8 = 0x80
pub const COMPRESSED_TIMESTAMP_MASK: u8 = 0x80
Bit 7. When set, this is a CompressedTimestamp data record.
Sourcepub const DEFINITION_MASK: u8 = 0x40
pub const DEFINITION_MASK: u8 = 0x40
Bit 6 (only meaningful when bit 7 = 0). When set, this is a Definition.
Sourcepub const DEV_DATA_MASK: u8 = 0x20
pub const DEV_DATA_MASK: u8 = 0x20
Bit 5 (only meaningful when bit 6 = 1). When set, the Definition contains developer-field declarations.
Sourcepub const LOCAL_MESG_NUM_MASK: u8 = 0x0F
pub const LOCAL_MESG_NUM_MASK: u8 = 0x0F
Bits [3:0]. Local message number for Definition / Data records.
Sourcepub const COMPRESSED_LOCAL_MASK: u8 = 0x60
pub const COMPRESSED_LOCAL_MASK: u8 = 0x60
Bits [6:5]. Local message number when the compressed-timestamp bit is set.
Sourcepub const TIMESTAMP_OFFSET_MASK: u8 = 0x1F
pub const TIMESTAMP_OFFSET_MASK: u8 = 0x1F
Bits [4:0]. Timestamp delta for compressed-timestamp records (0..=31 seconds).
Sourcepub fn local_mesg_num(&self) -> u8
pub fn local_mesg_num(&self) -> u8
Local message number, common to all three record types.
Sourcepub fn has_dev_data(&self) -> bool
pub fn has_dev_data(&self) -> bool
True iff this is a Definition with the developer-data flag set.
Trait Implementations§
Source§impl Clone for RecordHeader
impl Clone for RecordHeader
Source§fn clone(&self) -> RecordHeader
fn clone(&self) -> RecordHeader
1.0.0 (const: unstable) · 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 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 ==.