Trait frunk_core::hlist::Selector [] [src]

pub trait Selector<S, I> {
    fn get(&self) -> &S;
}

Trait for retrieving an HList element by type

Required Methods

Allows you to retrieve a unique type from an HList

Examples

let h = hlist![1, "hello", true, 42f32];

let f: &f32 = h.get();
let b: &bool = h.get();
assert_eq!(*f, 42f32);
assert!(b)Run

Implementors