[][src]Struct ndarray::SliceInfo

#[repr(C)]
pub struct SliceInfo<T: ?Sized, D: Dimension> { /* fields omitted */ }

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().

Methods

impl<T, D> SliceInfo<T, D> where
    T: AsRef<[SliceOrIndex]>,
    D: Dimension
[src]

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]

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> Clone for SliceInfo<T, D> where
    T: Clone,
    D: Dimension
[src]

impl<T, D> AsRef<[SliceOrIndex]> for SliceInfo<T, D> where
    T: AsRef<[SliceOrIndex]>,
    D: Dimension
[src]

impl<T, D> AsRef<SliceInfo<[SliceOrIndex], D>> for SliceInfo<T, D> where
    T: AsRef<[SliceOrIndex]>,
    D: Dimension
[src]

impl<T, D> Copy for SliceInfo<T, D> where
    T: Copy,
    D: Dimension
[src]

impl<T: ?Sized, D> Deref for SliceInfo<T, D> where
    D: Dimension
[src]

type Target = T

The resulting type after dereferencing.

impl<T: Debug + ?Sized, D: Debug + Dimension> Debug for SliceInfo<T, D>[src]

Auto Trait Implementations

impl<T: ?Sized, D> Send for SliceInfo<T, D> where
    T: Send

impl<T: ?Sized, D> Unpin for SliceInfo<T, D> where
    D: Unpin,
    T: Unpin

impl<T: ?Sized, D> Sync for SliceInfo<T, D> where
    T: Sync

impl<T: ?Sized, D> RefUnwindSafe for SliceInfo<T, D> where
    D: RefUnwindSafe,
    T: RefUnwindSafe

impl<T: ?Sized, D> UnwindSafe for SliceInfo<T, D> where
    D: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]