pub struct Schema { /* private fields */ }
Expand description
A schema suitable for parsing a given kind of event.
It is usually retrieved from crate::schema_locator::SchemaLocator::event_schema
.
This structure is basically a wrapper over a TraceEventInfo, with a few info parsed (and cached) out of it
Implementations§
source§impl Schema
impl Schema
sourcepub fn decoding_source(&self) -> DecodingSource
pub fn decoding_source(&self) -> DecodingSource
Use the decoding_source
function to obtain the DecodingSource from the TRACE_EVENT_INFO
This getter returns the DecodingSource from the event, this value identifies the source used parse the event data
Example
let my_callback = |record: &EventRecord, schema_locator: &SchemaLocator| {
let schema = schema_locator.event_schema(record).unwrap();
let decoding_source = schema.decoding_source();
};
sourcepub fn provider_name(&self) -> String
pub fn provider_name(&self) -> String
Use the provider_name
function to obtain the Provider name from the TRACE_EVENT_INFO
Example
let my_callback = |record: &EventRecord, schema_locator: &SchemaLocator| {
let schema = schema_locator.event_schema(record).unwrap();
let provider_name = schema.provider_name();
};
sourcepub fn opcode_name(&self) -> String
pub fn opcode_name(&self) -> String
Use the opcode_name
function to obtain the Opcode name from the TRACE_EVENT_INFO
See: OpcodeType
Example
let my_callback = |record: &EventRecord, schema_locator: &SchemaLocator| {
let schema = schema_locator.event_schema(record).unwrap();
let opcode_name = schema.opcode_name();
};