CTCons

Trait CTCons 

Source
pub trait CTCons {
    type Head: 'static;
    type Tail: CTCons + 'static;
}
Expand description

Represents a cons list where each new addition builds further onto the previous list. The previous list is at CTCons::Tail and CTConsTerm is used as bootstrapper to create the initial tail. The latest item is at CTCons::Head.

Use CTAppend to add new types to the cons list.

§Preconditions

  • The cons list MUST NOT contain multiple items of the exact same type. This will result in wrong offsets. Type X and Type Y are considered exactly the same if their TypeId match. eg std::any::TypeId::of::<X> == std::any::TypeId::of::<Y> See std::any::TypeId.

Required Associated Types§

Source

type Head: 'static

The head of the list. This is exactly one item.

Source

type Tail: CTCons + 'static

This is the parent of the implemented type. The tail contains all items except the Head of the implemented type.

Implementors§

Source§

impl CTCons for CTConsTerm

Source§

impl<Tail, Head> CTCons for Cons<Tail, Head>
where Tail: CTCons + 'static, Head: 'static,

Source§

type Head = Head

Source§

type Tail = Tail