derive_more icon indicating copy to clipboard operation
derive_more copied to clipboard

Possible feature: deriving std::io::{Read, Write}

Open saghm opened this issue 6 years ago • 1 comments
trafficstars

I'm not sure if this has been proposed before, but has there been any thought to implementing support for deriving the Read and Write traits from std::io? I think it might be useful to save boilerplate when making an enum where each of the variants contains something that implements Read/Write.

saghm avatar Aug 27 '19 19:08 saghm

The first step would be to implement those for newtypes, which should be fairly simple. But the other part of your idea is quite interesting: deriving traits for an enum where each of the variants implement that trait. Deriving for an enum containing only newtypes like deriving for a newtype.

JelteF avatar Aug 27 '19 19:08 JelteF