Trait frunk_core::hlist::Sculptor [] [src]

pub trait Sculptor<Target, Indices> {
    type Remainder;
    fn sculpt(self) -> (Target, Self::Remainder);
}

An Sculptor trait, that allows us to extract/reshape/scult the current HList into another shape, provided that the requested shape's types are are contained within the current HList.

The "Indices" type parameter allows the compiler to figure out that the Target and Self can be morphed into each other

Associated Types

Required Methods

Consumes the current HList and returns an HList with the requested shape.

Examples

let h = hlist![9000, "joe", 41f32, true];
let (reshaped, remainder): (Hlist![f32, i32, &str], _) = h.sculpt();
assert_eq!(reshaped, hlist![41f32, 9000, "joe"]);
assert_eq!(remainder, hlist![true]);Run

Implementors