pub enum CompiledFilter {
And(Vec<CompiledFilter>),
Or(Vec<CompiledFilter>),
Not(Box<CompiledFilter>),
Eq {
segments: Vec<CompiledSegment>,
value: Value,
},
}Expand description
Pre-compiled filter where every dot-path is split + each segment’s
integer parse is cached. Produced once via Filter::compile and
reused across every event in a poll.
Pre-fix perf #15 / #16 in docs/internal/performance/net-perf-analysis.md
every event in the filtered-poll retain loop re-split the path on
'.' and re-parsed each segment as usize. For a 10K-event response
with a 3-segment path, that was 30K path splits + ~30K speculative
integer parses, all producing the same compile-time-known segments.
Variants§
And(Vec<CompiledFilter>)
Pre-compiled AND.
Or(Vec<CompiledFilter>)
Pre-compiled OR.
Not(Box<CompiledFilter>)
Pre-compiled NOT.
Eq
Pre-compiled equality match with the path already split.
Fields
segments: Vec<CompiledSegment>Path segments, pre-split and per-segment index-parsed.
Implementations§
Source§impl CompiledFilter
impl CompiledFilter
Sourcepub fn matches(&self, event: &JsonValue) -> bool
pub fn matches(&self, event: &JsonValue) -> bool
Evaluate the compiled filter against an event. Semantically
identical to Filter::matches.
Trait Implementations§
Source§impl Clone for CompiledFilter
impl Clone for CompiledFilter
Source§fn clone(&self) -> CompiledFilter
fn clone(&self) -> CompiledFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more