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.
Sourcepub fn compile(&self) -> CompiledFilter
pub fn compile(&self) -> CompiledFilter
Pre-split every path and pre-parse each segment’s integer
form into a CompiledFilter. Call once per poll before
the per-event retain loop — see perf #15 / #16.