pub enum NormalizedSelection {
False,
True,
All(Box<NormalizedSelection>),
First(Box<NormalizedSelection>),
Range(Range, Box<NormalizedSelection>),
Label(Vec<LabelKey>, Box<NormalizedSelection>),
Any(Box<NormalizedSelection>),
Union(BTreeSet<NormalizedSelection>),
Intersection(BTreeSet<NormalizedSelection>),
}
Expand description
A normalized form of Selection
, used during canonicalization.
This structure uses BTreeSet
for Union
and Intersection
to
enable flattening, deduplication, and deterministic ordering.
Variants§
False
True
All(Box<NormalizedSelection>)
First(Box<NormalizedSelection>)
Range(Range, Box<NormalizedSelection>)
Label(Vec<LabelKey>, Box<NormalizedSelection>)
Any(Box<NormalizedSelection>)
Union(BTreeSet<NormalizedSelection>)
Intersection(BTreeSet<NormalizedSelection>)
Implementations§
Source§impl NormalizedSelection
impl NormalizedSelection
Sourcepub fn trav<F>(self, f: F) -> NormalizedSelection
pub fn trav<F>(self, f: F) -> NormalizedSelection
Applies a transformation to each child node of the selection.
This performs a single-layer traversal, applying f
to each
immediate child and reconstructing the outer node with the
transformed children.
Source§impl NormalizedSelection
impl NormalizedSelection
pub fn rewrite_bottom_up(self, rule: &impl RewriteRule) -> NormalizedSelection
Trait Implementations§
Source§impl Clone for NormalizedSelection
impl Clone for NormalizedSelection
Source§fn clone(&self) -> NormalizedSelection
fn clone(&self) -> NormalizedSelection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NormalizedSelection
impl Debug for NormalizedSelection
Source§impl From<NormalizedSelection> for Selection
impl From<NormalizedSelection> for Selection
Source§fn from(norm: NormalizedSelection) -> Selection
fn from(norm: NormalizedSelection) -> Selection
Converts the normalized form back into a standard Selection
.
Logical semantics are preserved, but normalized shape (e.g., set-based unions and intersections) is reconstructed as left-associated binary trees.
Source§impl Hash for NormalizedSelection
impl Hash for NormalizedSelection
Source§impl Ord for NormalizedSelection
impl Ord for NormalizedSelection
Source§fn cmp(&self, other: &NormalizedSelection) -> Ordering
fn cmp(&self, other: &NormalizedSelection) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for NormalizedSelection
impl PartialEq for NormalizedSelection
Source§impl PartialOrd for NormalizedSelection
impl PartialOrd for NormalizedSelection
Source§impl SelectionSYM for NormalizedSelection
impl SelectionSYM for NormalizedSelection
Source§fn true_() -> NormalizedSelection
fn true_() -> NormalizedSelection
The universal selection (matches all nodes).
Source§fn false_() -> NormalizedSelection
fn false_() -> NormalizedSelection
The identity selection (matches no nodes).
Source§fn all(inner: NormalizedSelection) -> NormalizedSelection
fn all(inner: NormalizedSelection) -> NormalizedSelection
Selects all values along the current dimension, then applies
the inner selection.
Source§fn first(inner: NormalizedSelection) -> NormalizedSelection
fn first(inner: NormalizedSelection) -> NormalizedSelection
Selects the first index along the current dimension for which
the inner selection is non-empty.
Source§fn range<R>(range: R, inner: NormalizedSelection) -> NormalizedSelection
fn range<R>(range: R, inner: NormalizedSelection) -> NormalizedSelection
Selects values within the given range along the current
dimension, then applies the inner selection.
Source§fn label<L>(labels: Vec<L>, inner: NormalizedSelection) -> NormalizedSelection
fn label<L>(labels: Vec<L>, inner: NormalizedSelection) -> NormalizedSelection
Selects values along the current dimension that match the
given labels, then applies the inner selection.
Source§fn any(inner: NormalizedSelection) -> NormalizedSelection
fn any(inner: NormalizedSelection) -> NormalizedSelection
Selects a random index along the current dimension, then applies
the inner selection.
Source§fn intersection(
lhs: NormalizedSelection,
rhs: NormalizedSelection,
) -> NormalizedSelection
fn intersection( lhs: NormalizedSelection, rhs: NormalizedSelection, ) -> NormalizedSelection
The intersection (logical AND) of two selection expressions.
Source§fn union(
lhs: NormalizedSelection,
rhs: NormalizedSelection,
) -> NormalizedSelection
fn union( lhs: NormalizedSelection, rhs: NormalizedSelection, ) -> NormalizedSelection
The union (logical OR) of two selection expressions.
impl Eq for NormalizedSelection
impl StructuralPartialEq for NormalizedSelection
Auto Trait Implementations§
impl Freeze for NormalizedSelection
impl RefUnwindSafe for NormalizedSelection
impl Send for NormalizedSelection
impl Sync for NormalizedSelection
impl Unpin for NormalizedSelection
impl UnwindSafe for NormalizedSelection
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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