[][src]Macro uninit::__auto_impl__

macro_rules! __auto_impl__ {
    (
    #[derived_from(ReadIntoUninit)]
    impl $( [$($generics:tt)*] )? Read for $T:ty
    $(
        where
        $($where_clause:tt)*
    )?
) => { ... };
}

Helper macro to alleviate the code duplication from implementing both Read and ReadIntoUninit.

Once some type T implements ReadIntoUninit, you can derive Read by doing:

::uninit::read::auto_impl! {
    #[derived_from(ReadIntoUninit)]
    impl Read for X
}
// and if X is generic, over, for instance, `Generics`
::uninit::read::auto_impl! {
    #[derived_from(ReadIntoUninit)]
    impl[Generics] Read for X<Generics>
}