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.
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.
Converts this type into a shared reference of the (usually inferred) input type.
The resulting type after dereferencing.
Dereferences the value.
Converts to this type from the input type.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
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.