File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change
1
+ # filterable-enum
2
+
3
+ Filterable wrapper for discriminated unions(DU) in rust.
4
+
5
+ ## What is this?
6
+
7
+ In some cases, you may want to filter a DU by a bitmask to check if it matches a subset of all variants.
8
+ This crate provides a derive macro to generate a filterable wrapper for a DU.
9
+
10
+ Ideally, I think this whole crate should be unnecessary. Rust already stores a tag for representing the variant of a DU.
11
+ However, Rust does not expose this tag to the user, so I cannot really use that tag as a bitflag.
12
+
13
+ ## Note
14
+
15
+ This is the first procedural macro I've ever written, so I'm not sure if I'm doing it idiomatic or right.
16
+ Feel free to open an issue or PR if you have any suggestions or improvements.
You can’t perform that action at this time.
0 commit comments