Trait frunk_core::hlist::LiftFrom [−][src]
Indexed type conversions of T -> Self
with index I
.
This is a generalized version of From
which for example allows the caller
to use default values for parts of Self
and thus “fill in the blanks”.
LiftFrom
is the reciprocal of LiftInto
.
use frunk::lift_from; use frunk::prelude::*; type H = Hlist![(), usize, f64, (), bool]; let x = H::lift_from(42.0); assert_eq!(x, hlist![(), 0, 42.0, (), false]); let x: H = lift_from(true); assert_eq!(x, hlist![(), 0, 0.0, (), true]);Run
Required methods
Loading content...Implementors
impl<Head, Tail, ValAtIx, TailIx> LiftFrom<ValAtIx, There<TailIx>> for HCons<Head, Tail> where
Head: Default,
Tail: HList + LiftFrom<ValAtIx, TailIx>,
[src]
Head: Default,
Tail: HList + LiftFrom<ValAtIx, TailIx>,
impl<Prefix, Suffix> LiftFrom<Prefix, Suffixed<Suffix>> for <Prefix as Add<Suffix>>::Output where
Prefix: HList + Add<Suffix>,
Suffix: Default,
[src]
Prefix: HList + Add<Suffix>,
Suffix: Default,
impl<T, Tail> LiftFrom<T, Here> for HCons<T, Tail> where
Tail: Default + HList,
[src]
Tail: Default + HList,