ConstShape

Trait ConstShape 

Source
pub trait ConstShape<const N: usize> {
    type Coord;

    const SIZE: Self::Coord;
    const USIZE: usize;
    const ARRAY: [Self::Coord; N];

    // Required methods
    fn linearize(p: [Self::Coord; N]) -> Self::Coord;
    fn delinearize(i: Self::Coord) -> [Self::Coord; N];
}
Expand description

A constant shape of an N-dimensional array.

Required Associated Constants§

Source

const SIZE: Self::Coord

The number of elements in an array with this shape.

Source

const USIZE: usize

Same as Self::SIZE as usize.

Source

const ARRAY: [Self::Coord; N]

The dimensions of the shape.

Required Associated Types§

Required Methods§

Source

fn linearize(p: [Self::Coord; N]) -> Self::Coord

Translate an N-dimensional vector into a single number T that can be used for linear indexing.

Source

fn delinearize(i: Self::Coord) -> [Self::Coord; N]

The inverse of linearize.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<const X: i8, const Y: i8> ConstShape<2> for ConstPow2Shape2i8<X, Y>

Source§

impl<const X: i8, const Y: i8> ConstShape<2> for ConstShape2i8<X, Y>

Source§

impl<const X: i8, const Y: i8, const Z: i8> ConstShape<3> for ConstPow2Shape3i8<X, Y, Z>

Source§

impl<const X: i8, const Y: i8, const Z: i8> ConstShape<3> for ConstShape3i8<X, Y, Z>

Source§

impl<const X: i8, const Y: i8, const Z: i8, const W: i8> ConstShape<4> for ConstPow2Shape4i8<X, Y, Z, W>

Source§

impl<const X: i8, const Y: i8, const Z: i8, const W: i8> ConstShape<4> for ConstShape4i8<X, Y, Z, W>

Source§

impl<const X: i16, const Y: i16> ConstShape<2> for ConstPow2Shape2i16<X, Y>

Source§

impl<const X: i16, const Y: i16> ConstShape<2> for ConstShape2i16<X, Y>

Source§

impl<const X: i16, const Y: i16, const Z: i16> ConstShape<3> for ConstPow2Shape3i16<X, Y, Z>

Source§

impl<const X: i16, const Y: i16, const Z: i16> ConstShape<3> for ConstShape3i16<X, Y, Z>

Source§

impl<const X: i16, const Y: i16, const Z: i16, const W: i16> ConstShape<4> for ConstPow2Shape4i16<X, Y, Z, W>

Source§

impl<const X: i16, const Y: i16, const Z: i16, const W: i16> ConstShape<4> for ConstShape4i16<X, Y, Z, W>

Source§

impl<const X: i32, const Y: i32> ConstShape<2> for ConstPow2Shape2i32<X, Y>

Source§

impl<const X: i32, const Y: i32> ConstShape<2> for ConstShape2i32<X, Y>

Source§

impl<const X: i32, const Y: i32, const Z: i32> ConstShape<3> for ConstPow2Shape3i32<X, Y, Z>

Source§

impl<const X: i32, const Y: i32, const Z: i32> ConstShape<3> for ConstShape3i32<X, Y, Z>

Source§

impl<const X: i32, const Y: i32, const Z: i32, const W: i32> ConstShape<4> for ConstPow2Shape4i32<X, Y, Z, W>

Source§

impl<const X: i32, const Y: i32, const Z: i32, const W: i32> ConstShape<4> for ConstShape4i32<X, Y, Z, W>

Source§

impl<const X: i64, const Y: i64> ConstShape<2> for ConstPow2Shape2i64<X, Y>

Source§

impl<const X: i64, const Y: i64> ConstShape<2> for ConstShape2i64<X, Y>

Source§

impl<const X: i64, const Y: i64, const Z: i64> ConstShape<3> for ConstPow2Shape3i64<X, Y, Z>

Source§

impl<const X: i64, const Y: i64, const Z: i64> ConstShape<3> for ConstShape3i64<X, Y, Z>

Source§

impl<const X: i64, const Y: i64, const Z: i64, const W: i64> ConstShape<4> for ConstPow2Shape4i64<X, Y, Z, W>

Source§

impl<const X: i64, const Y: i64, const Z: i64, const W: i64> ConstShape<4> for ConstShape4i64<X, Y, Z, W>

Source§

impl<const X: u8, const Y: u8> ConstShape<2> for ConstPow2Shape2u8<X, Y>

Source§

impl<const X: u8, const Y: u8> ConstShape<2> for ConstShape2u8<X, Y>

Source§

impl<const X: u8, const Y: u8, const Z: u8> ConstShape<3> for ConstPow2Shape3u8<X, Y, Z>

Source§

impl<const X: u8, const Y: u8, const Z: u8> ConstShape<3> for ConstShape3u8<X, Y, Z>

Source§

impl<const X: u8, const Y: u8, const Z: u8, const W: u8> ConstShape<4> for ConstPow2Shape4u8<X, Y, Z, W>

Source§

impl<const X: u8, const Y: u8, const Z: u8, const W: u8> ConstShape<4> for ConstShape4u8<X, Y, Z, W>

Source§

impl<const X: u16, const Y: u16> ConstShape<2> for ConstPow2Shape2u16<X, Y>

Source§

impl<const X: u16, const Y: u16> ConstShape<2> for ConstShape2u16<X, Y>

Source§

impl<const X: u16, const Y: u16, const Z: u16> ConstShape<3> for ConstPow2Shape3u16<X, Y, Z>

Source§

impl<const X: u16, const Y: u16, const Z: u16> ConstShape<3> for ConstShape3u16<X, Y, Z>

Source§

impl<const X: u16, const Y: u16, const Z: u16, const W: u16> ConstShape<4> for ConstPow2Shape4u16<X, Y, Z, W>

Source§

impl<const X: u16, const Y: u16, const Z: u16, const W: u16> ConstShape<4> for ConstShape4u16<X, Y, Z, W>

Source§

impl<const X: u32, const Y: u32> ConstShape<2> for ConstPow2Shape2u32<X, Y>

Source§

impl<const X: u32, const Y: u32> ConstShape<2> for ConstShape2u32<X, Y>

Source§

impl<const X: u32, const Y: u32, const Z: u32> ConstShape<3> for ConstPow2Shape3u32<X, Y, Z>

Source§

impl<const X: u32, const Y: u32, const Z: u32> ConstShape<3> for ConstShape3u32<X, Y, Z>

Source§

impl<const X: u32, const Y: u32, const Z: u32, const W: u32> ConstShape<4> for ConstPow2Shape4u32<X, Y, Z, W>

Source§

impl<const X: u32, const Y: u32, const Z: u32, const W: u32> ConstShape<4> for ConstShape4u32<X, Y, Z, W>

Source§

impl<const X: u64, const Y: u64> ConstShape<2> for ConstPow2Shape2u64<X, Y>

Source§

impl<const X: u64, const Y: u64> ConstShape<2> for ConstShape2u64<X, Y>

Source§

impl<const X: u64, const Y: u64, const Z: u64> ConstShape<3> for ConstPow2Shape3u64<X, Y, Z>

Source§

impl<const X: u64, const Y: u64, const Z: u64> ConstShape<3> for ConstShape3u64<X, Y, Z>

Source§

impl<const X: u64, const Y: u64, const Z: u64, const W: u64> ConstShape<4> for ConstPow2Shape4u64<X, Y, Z, W>

Source§

impl<const X: u64, const Y: u64, const Z: u64, const W: u64> ConstShape<4> for ConstShape4u64<X, Y, Z, W>

Source§

impl<const X: usize, const Y: usize> ConstShape<2> for ConstPow2Shape2usize<X, Y>

Source§

impl<const X: usize, const Y: usize> ConstShape<2> for ConstShape2usize<X, Y>

Source§

impl<const X: usize, const Y: usize, const Z: usize> ConstShape<3> for ConstPow2Shape3usize<X, Y, Z>

Source§

impl<const X: usize, const Y: usize, const Z: usize> ConstShape<3> for ConstShape3usize<X, Y, Z>

Source§

impl<const X: usize, const Y: usize, const Z: usize, const W: usize> ConstShape<4> for ConstPow2Shape4usize<X, Y, Z, W>

Source§

impl<const X: usize, const Y: usize, const Z: usize, const W: usize> ConstShape<4> for ConstShape4usize<X, Y, Z, W>