typeshaper 0.1.2

TypeScript utility-type idioms (Omit, Pick, Merge, Partial…) for Rust structs — one-line type algebra expressions
Documentation
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 {}