pub struct JsonEvent<'a> { /* private fields */ }Expand description
Zero-copy event backed by serde_json::Value.
Supports both borrowed (&Value) and owned (Value) backing via Cow.
This is the primary implementation for JSON/NDJSON input.
Flat keys are checked first: "actor.id" as a single key takes precedence
over {"actor": {"id": ...}} nested traversal.
Implementations§
Trait Implementations§
Source§impl<'a> Event for JsonEvent<'a>
impl<'a> Event for JsonEvent<'a>
Source§fn get_field(&self, path: &str) -> Option<EventValue<'_>>
fn get_field(&self, path: &str) -> Option<EventValue<'_>>
Get a field value by name, supporting dot-notation for nested access.
Checks for a flat key first (exact match), then falls back to dot-separated traversal. When a path segment yields an array, each element is tried and the first match is returned (OR semantics).
Source§fn any_string_value(&self, pred: &dyn Fn(&str) -> bool) -> bool
fn any_string_value(&self, pred: &dyn Fn(&str) -> bool) -> bool
Check if any string value in the event satisfies a predicate.
Short-circuits on the first match, avoiding the allocation of
collecting all string values into a Vec.
Source§fn all_string_values(&self) -> Vec<Cow<'_, str>>
fn all_string_values(&self) -> Vec<Cow<'_, str>>
Iterate over all string values in the event (for keyword detection).
Recursively walks the entire event object and yields every string value found, including inside nested objects and arrays. Traversal is capped at 64 levels of nesting to prevent stack overflow.