Trait 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.

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<H, T: TList> NonEmpty for TCons<H, T>

Source§

type First = H

Source§

type Rest = T

Source§

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

Source§

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