Skip to main content

AsShape

Trait AsShape 

Source
pub trait AsShape<L: Layout> {
    // Required method
    fn as_shape(&self) -> L::Shape<'_>;
}
Expand description

Trait for converting types into shapes for a given layout.

Required Methods§

Source

fn as_shape(&self) -> L::Shape<'_>

Convert self into an index for use the layout L.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AsShape<NdLayout<1>> for usize

Source§

fn as_shape(&self) -> [usize; 1]

Source§

impl<const N: usize> AsShape<NdLayout<N>> for [usize; N]

Source§

fn as_shape(&self) -> [usize; N]

Implementors§