Trait ConstLength

Source
pub trait ConstLength {
    const LEN: usize;
}
Expand description

A trait implemented for entities with known length at compile-time.

This trait defines a constant LEN, representing the length of the entity.

Required Associated Constants§

Source

const LEN: usize

The length of the entity.

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.

Implementations on Foreign Types§

Source§

impl ConstLength for ()

Source§

const LEN: usize = 0usize

Source§

impl<E> ConstLength for (E, E)

Source§

const LEN: usize = 2usize

Source§

impl<E> ConstLength for (E, E, E)

Source§

const LEN: usize = 3usize

Source§

impl<E> ConstLength for (E, E, E, E)

Source§

const LEN: usize = 4usize

Source§

impl<E> ConstLength for (E,)

Source§

const LEN: usize = 1usize

Source§

impl<E, const N: usize> ConstLength for [E; N]

Source§

const LEN: usize = N

Source§

impl<T> ConstLength for &T
where T: ConstLength,

Implementation of ConstLength for references to entities.

Source§

const LEN: usize = T::LEN

Source§

impl<T> ConstLength for &mut T
where T: ConstLength,

Implementation of ConstLength for mutable references to entities.

Source§

const LEN: usize = T::LEN

Implementors§

Source§

impl ConstLength for Dim<[usize; 0]>

Source§

const LEN: usize = 0usize

Source§

impl ConstLength for Dim<[usize; 1]>

Source§

const LEN: usize = 1usize

Source§

impl ConstLength for Dim<[usize; 2]>

Source§

const LEN: usize = 2usize

Source§

impl ConstLength for Dim<[usize; 3]>

Source§

const LEN: usize = 3usize

Source§

impl<E, const N: usize> ConstLength for Vector<E, N>
where E: MatEl,

Source§

const LEN: usize = N