#[non_exhaustive]pub enum Slice {
All(),
None(),
Single(usize),
Range(Range<usize>),
Not(Box<Slice>),
And(Box<Slice>, Box<Slice>),
Or(Box<Slice>, Box<Slice>),
}
Expand description
A slice defines across one dimension what values are accepted, it can act like a filter. Slices can also be constructed via boolean logic operations in the same way as in predicate logic expressions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
All()
A slice that accepts all indexes
None()
A slice that accepts no indexes
Single(usize)
A slice that accepts only the provided index
Range(Range<usize>)
A slice that accepts only indexes within the range
Not(Box<Slice>)
A slice which rejects all indexes accepted by the argument, and accepts all indexes rejected by the argument.
And(Box<Slice>, Box<Slice>)
A slice which accepts only indexes accepted by both arguments, and rejects all others.
Or(Box<Slice>, Box<Slice>)
A slice which accepts indexes accepted by either arguments, and rejects only indexes accepted by neither. This is an inclusive or.
You could construct an exclusive or by using combinations of AND, OR and NOT as (a AND (NOT b)) OR ((NOT a) AND b) = a XOR b.