1 2 3 4 5 6 7 8 9 10 11 12 13 14
pub trait TypeshaperInto<T> { fn typeshaper_into(self) -> T; } pub trait TypeshaperExt: Sized { fn project<T>(self) -> T where Self: TypeshaperInto<T>, { <Self as TypeshaperInto<T>>::typeshaper_into(self) } } impl<T> TypeshaperExt for T {}