Struct ndarray::SliceInfo [−][src]
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
impl<T, D> SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
[src]
T: AsRef<[SliceOrIndex]>,
D: Dimension,
pub fn new(indices: T) -> Result<SliceInfo<T, D>, ShapeError>
[src]
Returns a new SliceInfo
instance.
Errors if D
is not consistent with indices
.
impl<T: ?Sized, D> SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
[src]
T: AsRef<[SliceOrIndex]>,
D: Dimension,
pub fn out_ndim(&self) -> usize
[src]
Returns the number of dimensions after calling
.slice()
(including taking
subviews).
If D
is a fixed-size dimension type, then this is equivalent to
D::NDIM.unwrap()
. Otherwise, the value is calculated by iterating
over the ranges/indices.
Trait Implementations
impl<T, D> AsRef<[SliceOrIndex]> for SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
[src]
T: AsRef<[SliceOrIndex]>,
D: Dimension,
fn as_ref(&self) -> &[SliceOrIndex]ⓘ
[src]
impl<T, D> AsRef<SliceInfo<[SliceOrIndex], D>> for SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
[src]
T: AsRef<[SliceOrIndex]>,
D: Dimension,
impl<T, D> Clone for SliceInfo<T, D> where
T: Clone,
D: Dimension,
[src]
T: Clone,
D: Dimension,
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T, D> Copy for SliceInfo<T, D> where
T: Copy,
D: Dimension,
[src]
T: Copy,
D: Dimension,
impl<T: Debug + ?Sized, D: Debug + Dimension> Debug for SliceInfo<T, D>
[src]
impl<T: ?Sized, D> Deref for SliceInfo<T, D> where
D: Dimension,
[src]
D: Dimension,
Auto Trait Implementations
impl<T: ?Sized, D> RefUnwindSafe for SliceInfo<T, D> where
D: RefUnwindSafe,
T: RefUnwindSafe,
D: RefUnwindSafe,
T: RefUnwindSafe,
impl<T: ?Sized, D> Send for SliceInfo<T, D> where
T: Send,
T: Send,
impl<T: ?Sized, D> Sync for SliceInfo<T, D> where
T: Sync,
T: Sync,
impl<T: ?Sized, D> Unpin for SliceInfo<T, D> where
D: Unpin,
T: Unpin,
D: Unpin,
T: Unpin,
impl<T: ?Sized, D> UnwindSafe for SliceInfo<T, D> where
D: UnwindSafe,
T: UnwindSafe,
D: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,