Closed PookieBuns closed 5 months ago
If you actually need all 4 conversions, the best o2o has to offer is this:
#[derive(o2o::o2o)]
#[from_owned(i32| return MyWrapper(@))]
#[from_ref(i32| return MyWrapper(*@))]
#[into(i32| return @.0)]
struct MyWrapper(i32);
or this:
#[derive(o2o::o2o)]
#[from(i32)]
#[into(i32| return @.0)]
struct MyWrapper(#[from_owned(@)] #[from_ref(*@)] i32);
There used to be #[wrapped]
attribute, which was doing the same thing but in much shorter form, but its implementation was bloating code base too much so I ditched it..
Closing this as resolved, please reopen or create a new one if you have some other questions
how would we map wrapper types?