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/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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompiledFilter
impl RefUnwindSafe for CompiledFilter
impl Send for CompiledFilter
impl Sync for CompiledFilter
impl Unpin for CompiledFilter
impl UnsafeUnpin for CompiledFilter
impl UnwindSafe for CompiledFilter
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