derive_more
derive_more copied to clipboard
Feature: Bitwise operation derives
Hello and thanks for the great work to every contributor.
I was thinking, however rare, but maybe bitwise derives are missing for custom flag types (unnamed structs of bools or even vec/array of bools or something like that). Nothing fancy, but maybe for starters we can have some examples like below:
Proposed derives:
BitwiseAndBitwiseOrBitwiseXorBitwiseBool=BitwiseAnd + BitwiseOr + BitwiseXor
I'll be happy to contribute it myself however I am actually not certain about the quality of my code in Rust yet and also the package seems a bit over complicate and without a newbie friendly contribution guide.
Here is an example implementation: https://github.com/Davoodeh/bitwise/blob/master/src/lib.rs
@Davoodeh I'm not against having such derives in derive_more, but somewhat opposed to Bitwise* naming. As for me, it would be nice to preserve granularity and naming from std, in the manner we do for other traits.
@JelteF @ilslv what would you say?
@tyranron agreed, I would like for all derive macros having exact std trait name match.
Thank you for responding.
I have no comment on the naming. Just thought I introduce the idea. The rest of the hard work is for the contributors :D
I also implemented a full version here which has support for boolean fields or an array field or a vector field: https://github.com/Davoodeh/bitwise/blob/master/src/lib.rs
It's messy but might be helpful.