pub trait ChunkShapeTraits: AsRef<[NonZero<u64>]> + Sealed {
// Provided methods
fn to_array_shape(&self) -> Vec<u64> { ... }
fn num_elements(&self) -> NonZero<u64> { ... }
fn num_elements_nonzero_usize(&self) -> NonZero<usize> { ... }
fn num_elements_u64(&self) -> u64 { ... }
fn num_elements_usize(&self) -> usize { ... }
}Expand description
A trait for chunk shapes.
Provided Methods§
Sourcefn to_array_shape(&self) -> Vec<u64>
fn to_array_shape(&self) -> Vec<u64>
Convert a chunk shape to an array shape.
Sourcefn num_elements(&self) -> NonZero<u64>
fn num_elements(&self) -> NonZero<u64>
Return the number of elements.
Equal to the product of the components of its shape.
Sourcefn num_elements_nonzero_usize(&self) -> NonZero<usize>
fn num_elements_nonzero_usize(&self) -> NonZero<usize>
Return the number of elements as a nonzero usize.
Equal to the product of the components of its shape.
§Panics
Panics if the number of elements exceeds usize::MAX.
Sourcefn num_elements_u64(&self) -> u64
fn num_elements_u64(&self) -> u64
Return the number of elements as a u64.
Equal to the product of the components of its shape.
Sourcefn num_elements_usize(&self) -> usize
fn num_elements_usize(&self) -> usize
Return the number of elements as a usize.
Equal to the product of the components of its shape.
§Panics
Panics if the number of elements exceeds usize::MAX.