[−][src]Struct ndarray::SliceInfo
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]
impl<T, D> SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
pub fn new(indices: T) -> Result<SliceInfo<T, D>, ShapeError>
[src]
pub fn new(indices: T) -> Result<SliceInfo<T, D>, ShapeError>
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]
impl<T: ?Sized, D> SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
pub fn out_ndim(&self) -> usize
[src]
pub fn out_ndim(&self) -> usize
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: Debug + ?Sized, D: Debug + Dimension> Debug for SliceInfo<T, D>
[src]
impl<T: Debug + ?Sized, D: Debug + Dimension> Debug for SliceInfo<T, D>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: ?Sized, D> Deref for SliceInfo<T, D> where
D: Dimension,
[src]
impl<T: ?Sized, D> Deref for SliceInfo<T, D> where
D: Dimension,
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
fn deref(&self) -> &Self::Target
Dereferences the value.
impl<T, D> AsRef<[SliceOrIndex]> for SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
[src]
impl<T, D> AsRef<[SliceOrIndex]> for SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension,
fn as_ref(&self) -> &[SliceOrIndex]
[src]
fn as_ref(&self) -> &[SliceOrIndex]
Performs the conversion.
impl<T, D> AsRef<SliceInfo<[SliceOrIndex], D>> 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,
impl<T, D> Copy for SliceInfo<T, D> where
T: Copy,
D: Dimension,
[src]
impl<T, D> Copy for SliceInfo<T, D> where
T: Copy,
D: Dimension,
impl<T, D> Clone for SliceInfo<T, D> where
T: Clone,
D: Dimension,
[src]
impl<T, D> Clone for SliceInfo<T, D> where
T: Clone,
D: Dimension,
Auto Trait Implementations
impl<T: ?Sized, D> Send for SliceInfo<T, D> where
T: Send,
impl<T: ?Sized, D> Send for SliceInfo<T, D> where
T: Send,
impl<T: ?Sized, D> Sync for SliceInfo<T, D> where
T: Sync,
impl<T: ?Sized, D> Sync for SliceInfo<T, D> where
T: Sync,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more