Trait frunk_core::hlist::IntoTuple2 [] [src]

pub trait IntoTuple2 {
    type HeadType;
    type TailOutput;
    fn into_tuple2(self) -> (Self::HeadType, Self::TailOutput);
}

Trait for things that can be turned into a Tuple 2 (pair)

Associated Types

The 0 element in the output tuple

The 1 element in the output tuple

Required Methods

Turns an HList into nested Tuple2s, which are less troublesome to pattern match and have a nicer type signature.

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

// We now have a much nicer pattern matching experience
let (first,(second,(third, fourth))) = h.into_tuple2();

assert_eq!(first ,       1);
assert_eq!(second, "hello");
assert_eq!(third ,    true);
assert_eq!(fourth,   42f32);Run

Implementors