pub struct RawEventRecord<'a> {
pub record_type: RecordType,
pub misc: u16,
pub data: RawData<'a>,
pub parse_info: RecordParseInfo,
}
Expand description
An unparsed event record.
This can be converted into a parsed record by calling .parse()
.
The raw record also provides access to “common data” like the ID, timestamp,
tid etc., i.e. the information that was requested with SampleFormat
and
AttrFlags::SAMPLE_ID_ALL
.
Fields§
§record_type: RecordType
The record type. Must be a builtin type, i.e. not a user type.
misc: u16
The misc
value on this record.
data: RawData<'a>
The raw bytes in the body of this record.
parse_info: RecordParseInfo
The parse info from our corresponding evnt’s attr.
Implementations§
Source§impl<'a> RawEventRecord<'a>
impl<'a> RawEventRecord<'a>
Sourcepub fn new(
record_type: RecordType,
misc: u16,
data: RawData<'a>,
parse_info: RecordParseInfo,
) -> Self
pub fn new( record_type: RecordType, misc: u16, data: RawData<'a>, parse_info: RecordParseInfo, ) -> Self
Create a new RawEventRecord
. Must only be called if record_type.is_builtin_type()
is true
.
Sourcepub fn common_data(&self) -> Result<CommonData, Error>
pub fn common_data(&self) -> Result<CommonData, Error>
Parse “common data” on this record, see CommonData
.
The available information is determined by the event attr, specifically
by the requested SampleFormat
and by the
presence of the AttrFlags::SAMPLE_ID_ALL
flag: The SampleFormat
determines the available fields, and the
SAMPLE_ID_ALL
flag determines the record types on which these fields
are available. If SAMPLE_ID_ALL
is set, the requested fields are
available on all records, otherwise only on sample records
(RecordType::SAMPLE
).
Sourcepub fn parse(&self) -> Result<EventRecord<'a>, Error>
pub fn parse(&self) -> Result<EventRecord<'a>, Error>
Parses this raw record into an EventRecord
.
Trait Implementations§
Source§impl<'a> Clone for RawEventRecord<'a>
impl<'a> Clone for RawEventRecord<'a>
Source§fn clone(&self) -> RawEventRecord<'a>
fn clone(&self) -> RawEventRecord<'a>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more