logo
pub struct SliceInfo<T, Din, Dout> where
    Din: Dimension,
    Dout: Dimension
{ /* private fields */ }
Expand description

Represents all of the necessary information to perform a slice.

The type T is typically [SliceInfoElem; n], &[SliceInfoElem], or Vec<SliceInfoElem>. The type Din is the dimension of the array to be sliced, and Dout is the output dimension after calling .slice(). Note that if Din is a fixed dimension type (Ix0, Ix1, Ix2, etc.), the SliceInfo instance can still be used to slice an array with dimension IxDyn as long as the number of axes matches.

Implementations

Returns a new SliceInfo instance.

Errors if Din or Dout is not consistent with indices.

For common types, a safe alternative is to use TryFrom instead.

Safety

The caller must ensure indices.as_ref() always returns the same value when called multiple times.

Returns the number of dimensions of the input array for .slice().

If Din is a fixed-size dimension type, then this is equivalent to Din::NDIM.unwrap(). Otherwise, the value is calculated by iterating over the SliceInfoElem elements.

Returns the number of dimensions after calling .slice() (including taking subviews).

If Dout is a fixed-size dimension type, then this is equivalent to Dout::NDIM.unwrap(). Otherwise, the value is calculated by iterating over the SliceInfoElem elements.

Trait Implementations

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Performs the conversion.

Dimensionality of the output array.

Returns the number of axes in the input array.

Returns the number of axes in the output array.

This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more

Dimensionality of the output array.

Returns the number of axes in the input array.

Returns the number of axes in the output array.

This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more

Dimensionality of the output array.

Returns the number of axes in the input array.

Returns the number of axes in the output array.

This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more

Dimensionality of the output array.

Returns the number of axes in the input array.

Returns the number of axes in the output array.

This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more

Dimensionality of the output array.

Returns the number of axes in the input array.

Returns the number of axes in the output array.

This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more

Dimensionality of the output array.

Returns the number of axes in the input array.

Returns the number of axes in the output array.

This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more

Dimensionality of the output array.

Returns the number of axes in the input array.

Returns the number of axes in the output array.

This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more

Dimensionality of the output array.

Returns the number of axes in the input array.

Returns the number of axes in the output array.

This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.