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
Required Methods
fn into_tuple2(self) -> (Self::HeadType, Self::TailOutput)
Turns an HList into nested Tuple2s, which are less troublesome to pattern match and have a nicer type signature.
Examples
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
impl<T1, T2> IntoTuple2 for HCons<T1, HCons<T2, HNil>>
impl<T, Tail> IntoTuple2 for HCons<T, Tail> where
Tail: IntoTuple2,