pub trait DataSelector {
// Required method
fn resolve_indices(&self, count: usize) -> Vec<usize>;
// Provided method
fn is_contiguous(&self) -> bool { ... }
}Expand description
Trait for types that can specify a data selection (index-based dimension)
Required Methods§
Sourcefn resolve_indices(&self, count: usize) -> Vec<usize>
fn resolve_indices(&self, count: usize) -> Vec<usize>
Resolve this selection to indices (within the given count)
Provided Methods§
Sourcefn is_contiguous(&self) -> bool
fn is_contiguous(&self) -> bool
Returns true if this selector represents a contiguous range.
Range types (Range, RangeFrom, etc.) return true.
Index arrays (&usize, Vec
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl DataSelector for &[usize]
Multiple data indices
impl DataSelector for &[usize]
Multiple data indices
Source§impl DataSelector for Range<usize>
Data range selection
impl DataSelector for Range<usize>
Data range selection
fn resolve_indices(&self, count: usize) -> Vec<usize>
fn is_contiguous(&self) -> bool
Source§impl DataSelector for RangeFrom<usize>
Data range from selection
impl DataSelector for RangeFrom<usize>
Data range from selection
fn resolve_indices(&self, count: usize) -> Vec<usize>
fn is_contiguous(&self) -> bool
Source§impl DataSelector for RangeFull
Data full range selection
impl DataSelector for RangeFull
Data full range selection
fn resolve_indices(&self, count: usize) -> Vec<usize>
fn is_contiguous(&self) -> bool
Source§impl DataSelector for RangeInclusive<usize>
Data inclusive range selection
impl DataSelector for RangeInclusive<usize>
Data inclusive range selection
fn resolve_indices(&self, count: usize) -> Vec<usize>
fn is_contiguous(&self) -> bool
Source§impl DataSelector for RangeTo<usize>
Data range to selection
impl DataSelector for RangeTo<usize>
Data range to selection
fn resolve_indices(&self, count: usize) -> Vec<usize>
fn is_contiguous(&self) -> bool
Source§impl DataSelector for Vec<usize>
Multiple data indices (Vec)
impl DataSelector for Vec<usize>
Multiple data indices (Vec)
Source§impl DataSelector for usize
Single data index
impl DataSelector for usize
Single data index