Function frunk::hlist::h_cons

source ·
pub fn h_cons<H, T>(h: H, tail: T) -> HCons<H, T>where
    T: HList,
Expand description

Takes an element and an Hlist and returns another one with the element prepended to the original list. The original list is consumed

Examples

use frunk::hlist::{HNil, h_cons};

let h_list = h_cons("what", h_cons(1.23f32, HNil));
let (h1, h2) = h_list.into_tuple2();
assert_eq!(h1, "what");
assert_eq!(h2, 1.23f32);
Run