pub struct SelectionPretty(/* private fields */);
Expand description
A structured pretty-printer that renders Selection
expressions
in DSL constructor form.
This type implements SelectionSYM
and emits expressions like
all(range(0..4, true_()))
, which mirror the Rust-based DSL used
to construct Selection
values programmatically.
Internally used by [Selection::fmt
] to support human-readable
display of selection expressions in their canonical constructor
form.
Use Selection::fold
or the pretty
helper to produce a
SelectionPretty
:
use ndslice::selection::dsl::*;
use ndslice::selection::pretty::pretty;
let expr = all(range(0..4, true_()));
println!("{}", pretty(&expr)); // prints: all(range(0..4, true_()))
Trait Implementations§
Source§impl Display for SelectionPretty
impl Display for SelectionPretty
Source§impl SelectionSYM for SelectionPretty
impl SelectionSYM for SelectionPretty
Source§fn false_() -> SelectionPretty
fn false_() -> SelectionPretty
The identity selection (matches no nodes).
Source§fn true_() -> SelectionPretty
fn true_() -> SelectionPretty
The universal selection (matches all nodes).
Source§fn all(s: SelectionPretty) -> SelectionPretty
fn all(s: SelectionPretty) -> SelectionPretty
Selects all values along the current dimension, then applies
the inner selection.
Source§fn first(s: SelectionPretty) -> SelectionPretty
fn first(s: SelectionPretty) -> SelectionPretty
Selects the first index along the current dimension for which
the inner selection is non-empty.
Source§fn range<R>(range: R, s: SelectionPretty) -> SelectionPretty
fn range<R>(range: R, s: SelectionPretty) -> SelectionPretty
Selects values within the given range along the current
dimension, then applies the inner selection.
Source§fn label<L>(labels: Vec<L>, s: SelectionPretty) -> SelectionPretty
fn label<L>(labels: Vec<L>, s: SelectionPretty) -> SelectionPretty
Selects values along the current dimension that match the
given labels, then applies the inner selection.
Source§fn any(s: SelectionPretty) -> SelectionPretty
fn any(s: SelectionPretty) -> SelectionPretty
Selects a random index along the current dimension, then applies
the inner selection.
Source§fn intersection(a: SelectionPretty, b: SelectionPretty) -> SelectionPretty
fn intersection(a: SelectionPretty, b: SelectionPretty) -> SelectionPretty
The intersection (logical AND) of two selection expressions.
Source§fn union(a: SelectionPretty, b: SelectionPretty) -> SelectionPretty
fn union(a: SelectionPretty, b: SelectionPretty) -> SelectionPretty
The union (logical OR) of two selection expressions.
Auto Trait Implementations§
impl Freeze for SelectionPretty
impl RefUnwindSafe for SelectionPretty
impl Send for SelectionPretty
impl Sync for SelectionPretty
impl Unpin for SelectionPretty
impl UnwindSafe for SelectionPretty
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
§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