Skip to main content

ChunkShapeTraits

Trait ChunkShapeTraits 

Source
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§

Source

fn to_array_shape(&self) -> Vec<u64>

Convert a chunk shape to an array shape.

Source

fn num_elements(&self) -> NonZero<u64>

Return the number of elements.

Equal to the product of the components of its shape.

Source

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.

Source

fn num_elements_u64(&self) -> u64

Return the number of elements as a u64.

Equal to the product of the components of its shape.

Source

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.

Implementors§

Source§

impl<T> ChunkShapeTraits for T
where T: AsRef<[NonZero<u64>]>,