Expand description
Represents all of the necessary information to perform a slice.
The type T
is typically [SliceOrIndex; n]
, [SliceOrIndex]
, or
Vec<SliceOrIndex>
. The type D
is the output dimension after calling
.slice()
.
Implementations§
source§impl<T, D> SliceInfo<T, D>where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
impl<T, D> SliceInfo<T, D>where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
sourcepub fn new(indices: T) -> Result<SliceInfo<T, D>, ShapeError>
pub fn new(indices: T) -> Result<SliceInfo<T, D>, ShapeError>
Returns a new SliceInfo
instance.
Errors if D
is not consistent with indices
.
Trait Implementations§
source§impl<T, D> AsRef<[SliceOrIndex]> for SliceInfo<T, D>where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
impl<T, D> AsRef<[SliceOrIndex]> for SliceInfo<T, D>where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
source§fn as_ref(&self) -> &[SliceOrIndex]
fn as_ref(&self) -> &[SliceOrIndex]
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<T, D> AsRef<SliceInfo<[SliceOrIndex], D>> for SliceInfo<T, D>where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
impl<T, D> AsRef<SliceInfo<[SliceOrIndex], D>> for SliceInfo<T, D>where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
source§fn as_ref(&self) -> &SliceInfo<[SliceOrIndex], D>
fn as_ref(&self) -> &SliceInfo<[SliceOrIndex], D>
Converts this type into a shared reference of the (usually inferred) input type.