pub struct CompiledFilter { /* private fields */ }Expand description
A filter that has been compiled against a fixed column schema.
Cheap to clone (the op list is Vec<CompiledOp> and predicates
are already cloned at compile time).
Implementations§
Source§impl CompiledFilter
impl CompiledFilter
Sourcepub fn compile(
filter: &Filter,
schema: &HashMap<String, usize>,
) -> Result<Self, CompileError>
pub fn compile( filter: &Filter, schema: &HashMap<String, usize>, ) -> Result<Self, CompileError>
Compile a Filter against a column-name → slot-index map.
Returns CompileError::UnknownColumn when any predicate
references a column not in the schema.
Sourcepub fn op_count(&self) -> usize
pub fn op_count(&self) -> usize
Number of opcodes in the compiled program. Useful for tests and for diagnostics.
Sourcepub fn evaluate(&self, slot: &[Value]) -> bool
pub fn evaluate(&self, slot: &[Value]) -> bool
Evaluate the compiled filter against a row slot.
slot must be indexed by the same column-index map used at
compile time. Out-of-range indices are treated as
Value::Null (matching the legacy walker’s “column not
found” semantics).
Hot path — no allocation, no string lookup. The bool stack is
kept tiny (typical filter has ≤ 8 nesting levels) and lives
on the eval call’s local Vec.
Trait Implementations§
Source§impl Clone for CompiledFilter
impl Clone for CompiledFilter
Auto 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more