PopFront

Trait PopFront 

Source
pub trait PopFront: HList {
    type First;
    type Remainder: HList;

    // Required method
    fn pop_front(self) -> (Self::First, Self::Remainder);
}
Expand description

Remove the first element from the heterogenous list.

Required Associated Types§

Source

type First

The first element of the heterogenous list.

Source

type Remainder: HList

Remaining part of the heterogenous list without the first element.

Required Methods§

Source

fn pop_front(self) -> (Self::First, Self::Remainder)

Removes the first element from the heterogenous list.

New element will be removed from the beginning of the heterogenous list, resulting in pair of new heterogenous list and removed element.

§Examples
use hlist2::{hlist, ops::PopFront};

let list = hlist![1, 2.0, true];
let (elem, list) = list.pop_front();
assert_eq!(elem, 1);
assert_eq!(list, hlist![2.0, true]);

Implementors§

Source§

impl<Head, Tail> PopFront for Cons<Head, Tail>
where Tail: HList,

Source§

type First = Head

Source§

type Remainder = Tail