Skip to main content

ConstLength

Trait ConstLength 

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

Univeral vector. 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".

Implementations on Foreign Types§

Source§

impl ConstLength for ()

Source§

const LEN: usize = 0

Source§

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

Source§

const LEN: usize = N

Source§

impl<E> ConstLength for (E, E)

Source§

const LEN: usize = 2

Source§

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

Source§

const LEN: usize = 3

Source§

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

Source§

const LEN: usize = 4

Source§

impl<E> ConstLength for (E,)

Source§

const LEN: usize = 1

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§