pub struct RawEvent { /* private fields */ }Expand description
A single event from the trace, preserved as the underlying JSON object. Forward-compat escape hatch for callers who need to dispatch on event kinds the parser doesn’t model yet.
Implementations§
Source§impl RawEvent
impl RawEvent
Sourcepub fn kind(&self) -> Option<&str>
pub fn kind(&self) -> Option<&str>
Returns the value of the "type" field, or None if the event
is malformed (type absent or non-string). The streaming
iterators in crate::TraceReader filter out malformed events
before they reach the user, so handlers iterating on
TraceReader::raw_events can
generally expect this.
Sourcepub fn as_value(&self) -> &Map<String, Value>
pub fn as_value(&self) -> &Map<String, Value>
The full underlying JSON object, including the "type" field.
Sourcepub fn into_value(self) -> Value
pub fn into_value(self) -> Value
Take ownership of the underlying JSON.
Sourcepub fn into_typed(self) -> TraceEvent
pub fn into_typed(self) -> TraceEvent
Materialise the typed enum. Always succeeds — recognised kinds
become typed variants; anything else (including known kinds
whose schema we fail to deserialize) becomes
TraceEvent::Unknown.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawEvent
impl RefUnwindSafe for RawEvent
impl Send for RawEvent
impl Sync for RawEvent
impl Unpin for RawEvent
impl UnsafeUnpin for RawEvent
impl UnwindSafe for RawEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more