#[non_exhaustive]pub struct RawEvent<'a, 'f> {
pub type_id: WireTypeId,
pub name: &'f str,
pub timestamp_ns: u64,
pub fields: &'f [FieldValueRef<'a>],
pub schema: &'f SchemaEntry,
pub string_pool: &'f StringPool,
pub stack_pool: &'f StackPool,
}Expand description
A decoded event passed to Decoder::for_each_event.
'a is the lifetime of the input data buffer (strings, stack frames borrow from it).
'f is the lifetime of the fields slice and schema name (reused across calls).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.type_id: WireTypeId§name: &'f str§timestamp_ns: u64§fields: &'f [FieldValueRef<'a>]§schema: &'f SchemaEntry§string_pool: &'f StringPool§stack_pool: &'f StackPoolImplementations§
Source§impl<'a, 'f> RawEvent<'a, 'f>
impl<'a, 'f> RawEvent<'a, 'f>
Sourcepub fn field_names(&self) -> impl Iterator<Item = &'f str>
pub fn field_names(&self) -> impl Iterator<Item = &'f str>
Field names from the schema, parallel to fields.
Sourcepub fn deserialize<E: DeserializeOwned>(&self) -> Result<E, DeserError>
Available on crate feature serde-deserialize only.
pub fn deserialize<E: DeserializeOwned>(&self) -> Result<E, DeserError>
serde-deserialize only.Deserialize this event into a typed value E via serde.
The deserializer presents the event as a flat map containing:
"event"→ the schema name (the discriminant for#[serde(tag = "event")])."timestamp_ns"→ the absolute frame-header timestamp.- One entry per schema field, keyed by field name.
Pool-resolved values appear as their resolved form: PooledString
presents as a string, PooledStackFrames presents as a sequence of
u64. See crate::de for details.
Available only when the serde-deserialize feature is enabled.
Auto Trait Implementations§
impl<'a, 'f> Freeze for RawEvent<'a, 'f>
impl<'a, 'f> RefUnwindSafe for RawEvent<'a, 'f>
impl<'a, 'f> Send for RawEvent<'a, 'f>
impl<'a, 'f> Sync for RawEvent<'a, 'f>
impl<'a, 'f> Unpin for RawEvent<'a, 'f>
impl<'a, 'f> UnsafeUnpin for RawEvent<'a, 'f>
impl<'a, 'f> UnwindSafe for RawEvent<'a, 'f>
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