pub struct NullableIndexExprResult {
pub lower: NullableRowAddrMask,
pub upper: NullableRowAddrMask,
/* private fields */
}Expand description
Result of an index search before NULL rows are dropped. Each endpoint
is a NullableRowAddrMask carrying SQL three-valued logic info.
Fields§
§lower: NullableRowAddrMaskRows the index guarantees are TRUE.
upper: NullableRowAddrMaskRows that may be TRUE. Rows outside upper are guaranteed to be
FALSE / NULL (and so not in a WHERE answer set).
Implementations§
Source§impl NullableIndexExprResult
impl NullableIndexExprResult
Sourcepub fn exact(mask: NullableRowAddrMask) -> Self
pub fn exact(mask: NullableRowAddrMask) -> Self
Precise result — every row in mask is in the answer and every
row outside is not. Equivalent to the old Exact variant.
Sourcepub fn at_most(mask: NullableRowAddrMask) -> Self
pub fn at_most(mask: NullableRowAddrMask) -> Self
Upper-bound-only result — rows outside mask are guaranteed not
to match; rows inside may match and require a recheck.
Equivalent to the old AtMost variant.
Sourcepub fn at_least(mask: NullableRowAddrMask) -> Self
pub fn at_least(mask: NullableRowAddrMask) -> Self
Lower-bound-only result — rows in mask are guaranteed to match;
rows outside may match too and require a recheck. Equivalent to
the old AtLeast variant.
Sourcepub fn new(lower: NullableRowAddrMask, upper: NullableRowAddrMask) -> Self
pub fn new(lower: NullableRowAddrMask, upper: NullableRowAddrMask) -> Self
Construct an interval result from lower/upper bounds.
lower rows are guaranteed TRUE and upper rows may be TRUE, with
NULL state preserved at both endpoints. Equal endpoints are canonicalized
to Self::exact so is_exact() remains structural.
Sourcepub fn is_exact(&self) -> bool
pub fn is_exact(&self) -> bool
True if the result is exact — the answer is precisely the lower (== upper) mask.
This is a structural check on the canonical form produced by
the constructors / algebra: an Exact(m) built with
Self::exact holds equal masks, and elementwise & / | / !
preserve that. It is not a semantic emptiness test — a
hand-constructed IndexExprResult whose endpoints are
representationally distinct but semantically equal (e.g.
AllowList(universe) vs BlockList(empty)) will report
is_exact() == false. All in-tree code paths construct results
through the canonical builders, so this is sound in practice.
The three shape predicates are not mutually exclusive — see the
note on Self::is_at_least for the precedence convention.
Sourcepub fn is_at_most(&self) -> bool
pub fn is_at_most(&self) -> bool
True if lower matches no rows (canonical AllowList(∅)) — the
index gives only an upper bound on the answer.
Like Self::is_exact, this is a structural check on the
canonical form. See that doc for the caveat.
Sourcepub fn is_at_least(&self) -> bool
pub fn is_at_least(&self) -> bool
True if upper covers every row (canonical BlockList(∅)) — the
index gives only a lower bound on the answer.
Precedence convention for consumers branching on shape: check
Self::is_exact first (Exact-of-empty satisfies both
is_exact and is_at_most; Exact-of-universe satisfies both
is_exact and is_at_least); then is_at_least; finally treat
the residual as is_at_most or Refined. The branches in
filtered_read::apply_index_to_fragment follow this order.
Sourcepub fn drop_nulls(self) -> IndexExprResult
pub fn drop_nulls(self) -> IndexExprResult
Project NULL rows out of the result.
Under a WHERE clause NULL is treated as FALSE, so drop_nulls
folds NULL rows out of the answer at each endpoint.
Trait Implementations§
Source§impl BitAnd for NullableIndexExprResult
impl BitAnd for NullableIndexExprResult
Source§impl BitOr for NullableIndexExprResult
impl BitOr for NullableIndexExprResult
Source§impl Clone for NullableIndexExprResult
impl Clone for NullableIndexExprResult
Source§fn clone(&self) -> NullableIndexExprResult
fn clone(&self) -> NullableIndexExprResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NullableIndexExprResult
impl Debug for NullableIndexExprResult
Auto Trait Implementations§
impl Freeze for NullableIndexExprResult
impl RefUnwindSafe for NullableIndexExprResult
impl Send for NullableIndexExprResult
impl Sync for NullableIndexExprResult
impl Unpin for NullableIndexExprResult
impl UnsafeUnpin for NullableIndexExprResult
impl UnwindSafe for NullableIndexExprResult
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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