pub enum Filter {
And {
filters: Vec<Filter>,
},
Or {
filters: Vec<Filter>,
},
Not {
filter: Box<Filter>,
},
EqWrapped {
condition: EqCondition,
},
Eq {
path: String,
value: Value,
},
}Expand description
A filter predicate for matching events.
Variants§
And
Logical AND: all filters must match.
Or
Logical OR: at least one filter must match.
Not
Logical NOT: the inner filter must not match.
EqWrapped
Equality match with $eq wrapper: { "$eq": { "path": "...", "value": ... } }
Fields
§
condition: EqConditionThe equality condition.
Eq
Equality match (shorthand): { "path": "...", "value": ... }
Implementations§
Source§impl Filter
impl Filter
Sourcepub fn matches(&self, event: &JsonValue) -> bool
pub fn matches(&self, event: &JsonValue) -> bool
Check if an event matches this filter.
Empty And children are rejected as “matches nothing” rather
than “matches everything” — .all() on an empty iterator
returns true, which would silently turn an externally-
supplied filter JSON like {"and": []} into a universal
pass-through. Empty Or naturally returns false via
.any() on an empty iterator and keeps its documented
“matches nothing” behavior.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Filter
impl<'de> Deserialize<'de> for Filter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Filter
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnsafeUnpin for Filter
impl UnwindSafe for Filter
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