pub struct Event<'a> { /* private fields */ }Expand description
A reference to a JSON event for field access during evaluation.
Flat keys are checked first: "actor.id" as a single key takes precedence
over {"actor": {"id": ...}} nested traversal.
Implementations§
Source§impl<'a> Event<'a>
impl<'a> Event<'a>
Sourcepub fn from_value(value: &'a Value) -> Self
pub fn from_value(value: &'a Value) -> Self
Wrap a JSON value as an event.
Sourcepub fn get_field(&self, path: &str) -> Option<&'a Value>
pub fn get_field(&self, path: &str) -> Option<&'a Value>
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).
Sourcepub fn all_string_values(&self) -> Vec<&'a str>
pub fn all_string_values(&self) -> Vec<&'a 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.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Event<'a>
impl<'a> RefUnwindSafe for Event<'a>
impl<'a> Send for Event<'a>
impl<'a> Sync for Event<'a>
impl<'a> Unpin for Event<'a>
impl<'a> UnsafeUnpin for Event<'a>
impl<'a> UnwindSafe for Event<'a>
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