SliceInfo in ndarray - Rust

pub struct SliceInfo<T, 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.

Source§
Source

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.

Source

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.

Source

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.

Source§
Source§

Converts this type into a shared reference of the (usually inferred) input type.

Source§
Source§
Source§
Source§

The resulting type after dereferencing.

Source§

Dereferences the value.

Source§
Source§

Converts to this type from the input type.

Source§
Source§

Dimensionality of the output array.

Source§

Returns the number of axes in the input array.

Source§

Returns the number of axes in the output array.

Source§
Source§

Dimensionality of the output array.

Source§

Returns the number of axes in the input array.

Source§

Returns the number of axes in the output array.

Source§
Source§

Dimensionality of the output array.

Source§

Returns the number of axes in the input array.

Source§

Returns the number of axes in the output array.

Source§
Source§

Dimensionality of the output array.

Source§

Returns the number of axes in the input array.

Source§

Returns the number of axes in the output array.

Source§
Source§

Dimensionality of the output array.

Source§

Returns the number of axes in the input array.

Source§

Returns the number of axes in the output array.

Source§
Source§

Dimensionality of the output array.

Source§

Returns the number of axes in the input array.

Source§

Returns the number of axes in the output array.

Source§
Source§

Dimensionality of the output array.

Source§

Returns the number of axes in the input array.

Source§

Returns the number of axes in the output array.

Source§
Source§

Dimensionality of the output array.

Source§

Returns the number of axes in the input array.

Source§

Returns the number of axes in the output array.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§