derive_more
derive_more copied to clipboard
Possible feature: deriving std::io::{Read, Write}
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.
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.