[][src]Trait frunk_core::hlist::LiftInto

pub trait LiftInto<T, I> {
    fn lift_into(self) -> T;
}

An indexed conversion that consumes self, and produces a T. To produce T, the index I may be used to for example "fill in the blanks". LiftInto is the reciprocal of LiftFrom.

use frunk::prelude::*;

type H = Hlist![(), usize, f64, (), bool];

// Type inference works as expected:
let x: H = 1337.lift_into();
assert_eq!(x, hlist![(), 1337, 0.0, (), false]);

// Sublists:
let x: H = hlist![(), true].lift_into();
assert_eq!(x, hlist![(), 0, 0.0, (), true]);

let x: H = hlist![3.0, ()].lift_into();
assert_eq!(x, hlist![(), 0, 3.0, (), false]);

let x: H = hlist![(), 1337].lift_into();
assert_eq!(x, hlist![(), 1337, 0.0, (), false]);

let x: H = hlist![(), 1337, 42.0, (), true].lift_into();
assert_eq!(x, hlist![(), 1337, 42.0, (), true]);Run

Required Methods

Performs the indexed conversion.

Implementors

impl<T, U, I> LiftInto<U, I> for T where
    U: LiftFrom<T, I>, 
[src]