Struct ferrisetw::schema_locator::SchemaLocator
source · pub struct SchemaLocator { /* private fields */ }
Expand description
Represents a cache of Schemas already located
This cache is implemented as a HashMap where the key is a combination of the following elements of an Event Record
- EventHeader.ProviderId
- EventHeader.EventDescriptor.Id
- EventHeader.EventDescriptor.Opcode
- EventHeader.EventDescriptor.Version
- EventHeader.EventDescriptor.Level
Credits: KrabsETW::schema_locator.
See also the code of SchemaKey
for more info
Implementations§
source§impl SchemaLocator
impl SchemaLocator
sourcepub fn event_schema(
&self,
event: &EventRecord
) -> Result<Arc<Schema>, SchemaError>
pub fn event_schema( &self, event: &EventRecord ) -> Result<Arc<Schema>, SchemaError>
Retrieve the Schema of an ETW Event
Arguments
event
- The EventRecord that’s passed to the callback
Example
let my_callback = |record: &EventRecord, schema_locator: &SchemaLocator| {
let schema = schema_locator.event_schema(record).unwrap();
};
Trait Implementations§
source§impl Debug for SchemaLocator
impl Debug for SchemaLocator
source§impl Default for SchemaLocator
impl Default for SchemaLocator
source§fn default() -> SchemaLocator
fn default() -> SchemaLocator
Returns the “default value” for a type. Read more