Trait List

Source
pub trait List: List {
    type Head;
    type Tail: List;
    type IsEOL;

    const LEN: usize;

    // Required methods
    fn split(self) -> (<Self as List>::Head, <Self as List>::Tail);
    fn head(&self) -> &Self::Head;
    fn tail(&self) -> &Self::Tail;

    // Provided method
    fn into_iter_as<X>(self) -> Self::ListIter
       where Self: ListOf<X> { ... }
}

Required Associated Constants§

Required Associated Types§

Source

type Head

Source

type Tail: List

Source

type IsEOL

Required Methods§

Source

fn split(self) -> (<Self as List>::Head, <Self as List>::Tail)

Source

fn head(&self) -> &Self::Head

Source

fn tail(&self) -> &Self::Tail

Provided Methods§

Source

fn into_iter_as<X>(self) -> Self::ListIter
where Self: ListOf<X>,

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<T> List for T
where T: List,

Source§

const LEN: usize = <Self as internal::List>::ILEN

Source§

type Head = <T as List>::IHead

Source§

type Tail = <T as List>::ITail

Source§

type IsEOL = <T as List>::IIsEOL