pub enum Predicate {
Intersects(Bounds),
Within(Bounds),
Contains(Bounds),
CoveredBy(Bounds),
Covers(Bounds),
Disjoint(Bounds),
Overlaps(Bounds),
}Expand description
A spatial query against the index, expressed on bounding boxes.
Mirrors the index::detail::predicates family
(index/predicates.hpp). Each variant carries the query box.
Variants§
Intersects(Bounds)
Values whose bounds intersect the query box. Boost’s
index::intersects.
Within(Bounds)
Values whose non-degenerate bounds are fully inside the query
box. Boost’s index::within.
Contains(Bounds)
Values whose bounds contain a non-degenerate query box. Boost’s
index::contains.
CoveredBy(Bounds)
Values whose bounds are inside the query box, including
degenerate values and coincident boundaries. Boost’s
index::covered_by.
Covers(Bounds)
Values whose bounds contain the query box, including a
degenerate query. Boost’s index::covers.
Disjoint(Bounds)
Values whose bounds share no point with the query box. Boost’s
index::disjoint.
Overlaps(Bounds)
Values whose bounds overlap the query box without either box
covering the other. Boost’s index::overlaps.
Implementations§
Source§impl Predicate
impl Predicate
Sourcepub fn matches(&self, value: &Bounds) -> bool
pub fn matches(&self, value: &Bounds) -> bool
Whether a leaf value with box value satisfies this predicate.
Sourcepub fn could_match(&self, node: &Bounds) -> bool
pub fn could_match(&self, node: &Bounds) -> bool
Whether a subtree with box node could contain any matching
value — the pruning test. A subtree is skipped when this is
false.
Sourcepub fn covers_all(&self, node: &Bounds) -> bool
pub fn covers_all(&self, node: &Bounds) -> bool
Whether EVERY value in a subtree with box node is a guaranteed
match — the containment fast path. A covered subtree is dumped
without per-node or per-value tests.
Sound because a value’s box is contained in its node’s box:
Intersects and CoveredBy can dump a node covered by the
query, while Disjoint can dump one wholly apart from it.
Within cannot use the covered-node shortcut because a subtree
may contain degenerate values.
Sourcepub fn and<P>(self, other: P) -> AndPredicate<Self, P>
pub fn and<P>(self, other: P) -> AndPredicate<Self, P>
Combine this spatial predicate with another condition.