pub struct ComparisonMask { /* private fields */ }Expand description
Compiled slot comparisons for one scan.
One instance per walk. The allow-list road compiles it once against the
base pattern and reuses it across every tight prefix: a comparison on the
allow-listed slot is evaluated per row there, not folded per prefix. An
empty mask is the identity and costs one is_empty check per row.
Implementations§
Source§impl ComparisonMask
impl ComparisonMask
Sourcepub fn compile(
pattern: &EncodedTriplePattern,
permutation: IndexPermutation,
comparisons: &[SlotComparison],
) -> Self
pub fn compile( pattern: &EncodedTriplePattern, permutation: IndexPermutation, comparisons: &[SlotComparison], ) -> Self
Compile comparisons for a scan of pattern through permutation.
Comparisons on slots the pattern already binds are constant: a proven
false empties the scan, a proven true (or an undecidable) drops the
check. Slots the permutation omits (Tsg’s implicit rdf:type
predicate) are folded the same way. Graph-slot comparisons are ignored:
the wire never carries them, and a merge_default_graph scan rewrites
G after the matcher runs.
Sourcepub fn is_trivial(&self) -> bool
pub fn is_trivial(&self) -> bool
true when the mask has no per-row work.
Sourcepub fn keeps(&self, logical: &[u8], seg_starts: &[usize; 4]) -> bool
pub fn keeps(&self, logical: &[u8], seg_starts: &[usize; 4]) -> bool
Keep decision for one visible row.
logical is the term prefix (no commit-ts trailer); seg_starts is
the walked slot-offset table. The mask carries the permutation it was
compiled against, so a filter cannot be applied to a key walked in a
different index order. A malformed segment is kept: the corruption
belongs to the decode path, not to a mask verdict.
Trait Implementations§
Source§impl Clone for ComparisonMask
impl Clone for ComparisonMask
Source§fn clone(&self) -> ComparisonMask
fn clone(&self) -> ComparisonMask
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more