Len

Trait Len 

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

Heterogenous list with length (count of elements) known at compile-time.

Required Associated Constants§

Source

const LEN: usize

Length (count of elements) of the heterogenous list.

§Examples
use hlist2::{HList, Len};

assert_eq!(<HList![]>::LEN, 0);
assert_eq!(<HList![i32]>::LEN, 1);
assert_eq!(<HList![i32, f64, bool, &str]>::LEN, 4);

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 Len for Nil

Source§

const LEN: usize = 0usize

Source§

impl<Head, Tail> Len for Cons<Head, Tail>
where Tail: Len,