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§
Required Methods§
Sourcefn pop_front(self) -> (Self::First, Self::Remainder)
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]);