Struct ferrisetw::EventRecord

source ·
#[repr(transparent)]
pub struct EventRecord(_);
Expand description

A read-only wrapper over an EVENT_RECORD

Implementations§

The ProviderId field from the wrapped EVENT_RECORD

The Id field from the wrapped EVENT_RECORD

The Opcode field from the wrapped EVENT_RECORD

The Version field from the wrapped EVENT_RECORD

The Level field from the wrapped EVENT_RECORD

The Flags field from the wrapped EVENT_RECORD

The ProcessId field from the wrapped EVENT_RECORD

The ThreadId field from the wrapped EVENT_RECORD

The ActivityId field from the wrapped EVENT_RECORD

The TimeStamp field from the wrapped EVENT_RECORD

As per Microsoft’s documentation:

Contains the time that the event occurred.
The resolution is system time unless the ProcessTraceMode member of EVENT_TRACE_LOGFILE contains the PROCESS_TRACE_MODE_RAW_TIMESTAMP flag, in which case the resolution depends on the value of the Wnode.ClientContext member of EVENT_TRACE_PROPERTIES at the time the controller created the session.

Note: the time_rs Cargo feature enables to convert this into strongly-typed values

Returns the ExtendedData from the ETW Event

Their availability is mostly determined by the flags passed to Provider::trace_flags

Example
use windows::Win32::System::Diagnostics::Etw::EVENT_HEADER_EXT_TYPE_RELATED_ACTIVITYID;

let my_callback = |record: &EventRecord, schema_locator: &SchemaLocator| {
    let schema = schema_locator.event_schema(record).unwrap();
    let activity_id = record
        .extended_data()
        .iter()
        .find(|edata| edata.data_type() as u32 == EVENT_HEADER_EXT_TYPE_RELATED_ACTIVITYID)
        .map(|edata| edata.to_extended_data_item());
};

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.