Trait TraceEvent
pub trait TraceEvent {
// Required methods
fn event_name() -> &'static str;
fn field_defs() -> Vec<FieldDef>;
fn timestamp(&self) -> u64;
fn encode_fields<W>(
&self,
enc: &mut EventEncoder<'_, W>,
) -> Result<(), Error>
where W: Write;
// Provided methods
fn type_slot() -> u16 { ... }
fn schema_entry() -> SchemaEntry { ... }
}Available on crate feature
dial9 only.Expand description
Trait implemented by #[derive(TraceEvent)] for compile-time event types.
Required Methods§
fn event_name() -> &'static str
fn event_name() -> &'static str
The event type name (used in schema registration).
fn field_defs() -> Vec<FieldDef>
fn field_defs() -> Vec<FieldDef>
Field definitions for schema registration. The timestamp is NOT included here — it is encoded in the event frame header.
fn encode_fields<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>where
W: Write,
fn encode_fields<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>where
W: Write,
Encode this event’s non-timestamp fields into the encoder.
Provided Methods§
fn type_slot() -> u16
fn type_slot() -> u16
Per-type wire-ID slot. Default 0 means no slot (dynamic path);
#[traceevent(wire_slot)] overrides it to claim a fast-path slot.
fn schema_entry() -> SchemaEntry
fn schema_entry() -> SchemaEntry
Build a SchemaEntry for this event type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".