Macro to implement inherit
Provide class to cover a struct itself, it's impl and trait implements that need to inherit. To borrow as mut, see def_as_mut
macro class
need to wrap struct and implements.
using #[keep] for method make that method keep in the original impl.
methods without #[keep] will be put into trait __XXX__.
and macro will auto generate a new function which return Pin<Box>.
expression in the method will be converted.
instead of use self, using this.
self will be convert to use unsafe { self.__real__.as_ref().unwrap() }.
self_mut will be convert to use unsafe { self.__real__.as_mut().unwrap() }.
_super will be convert to use self.__prototype__.
_super_mut will be convert to use unsafe { self.__prototype__.as_mut().get_unchecked_mut() }.
macro def_as_mut
this macro will define macro as_mut
example:
class!
class!
the struct will become:
to borrow as mut:
def_as_mut!;