Trait tlist::NonEmpty

source ·
pub trait NonEmpty: TList + Sealed {
    type First;
    type Rest: TList;
    type Last;
    type Inits: TList;
}
Expand description

Non-empty TLists.

Any TList except TNil implements this constraining trait. (In other words: Any TCons<H, T>, regardless of what H or T it contains, implements it.)

Quite a number of operations are only defined for non-empty TLists, so this constraint is used a lot in the library itself as well.

See also TList::IS_EMPTY and IsEmpty if you want work with both Empty and NonEmpty lists generically.

Required Associated Types§

source

type First

Implementation of First.

source

type Rest: TList

Implementation of Rest.

source

type Last

Implementation of Last.

source

type Inits: TList

Implementation of Inits.

Implementors§

source§

impl<H, T: TList> NonEmpty for TCons<H, T>

§

type First = H

§

type Rest = T

§

type Last = <T as TListImpl>::Last<H>

§

type Inits = <T as TListImpl>::Inits<H>