Trait Selector
frunk_core::hlist
pub trait Selector<S, I> { fn get(&self) -> &S; }
Trait for retrieving an HList element by type
fn get(&self) -> &S
Allows you to retrieve a unique type from an HList
let h = hlist![1, "hello", true, 42f32]; let f: &f32 = h.get(); let b: &bool = h.get(); assert_eq!(*f, 42f32); assert!(b)Run
impl<T, Tail> Selector<T, Here> for HCons<T, Tail>
impl<Head, Tail, FromTail, TailIndex> Selector<FromTail, There<TailIndex>> for HCons<Head, Tail> where Tail: Selector<FromTail, TailIndex>,