Trait rin::math::base::SliceRange [−][src]
pub trait SliceRange<D> where
D: Dim, { type Size: Dim; pub fn begin(&self, shape: D) -> usize; pub fn end(&self, shape: D) -> usize; pub fn size(&self, shape: D) -> Self::Size; }
A range with a size that may be known at compile-time.
This may be:
- A single
usize
index, e.g.,4
- A left-open range
std::ops::RangeTo
, e.g.,.. 4
- A right-open range
std::ops::RangeFrom
, e.g.,4 ..
- A full range
std::ops::RangeFull
, e.g.,..
Associated Types
Loading content...Required methods
pub fn begin(&self, shape: D) -> usize
[src]
The start index of the range.
pub fn end(&self, shape: D) -> usize
[src]
The index immediately after the last index inside of the range.
pub fn size(&self, shape: D) -> Self::Size
[src]
The number of elements of the range, i.e., self.end - self.begin
.
Implementations on Foreign Types
impl<D> SliceRange<D> for RangeFrom<usize> where
D: Dim,
[src]
impl<D> SliceRange<D> for RangeFrom<usize> where
D: Dim,
[src]impl<D> SliceRange<D> for RangeFull where
D: Dim,
[src]
impl<D> SliceRange<D> for RangeFull where
D: Dim,
[src]impl<D> SliceRange<D> for RangeTo<usize> where
D: Dim,
[src]
impl<D> SliceRange<D> for RangeTo<usize> where
D: Dim,
[src]impl<D> SliceRange<D> for Range<usize> where
D: Dim,
[src]
impl<D> SliceRange<D> for Range<usize> where
D: Dim,
[src]impl<D> SliceRange<D> for usize where
D: Dim,
[src]
impl<D> SliceRange<D> for usize where
D: Dim,
[src]