[][src]Macro uninit::read::auto_impl

macro_rules! auto_impl {
    (
    #[derived_from(ReadIntoUninit)]
    impl $( [$($generics:tt)*] )? Read for $T:ty
    $(
        where
        $($where_clause:tt)*
    )?
) => { ... };
}
This is supported on feature="std" only.

Helper crate 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>
}