Skip to content

Commit 537efbe

Browse files
committed
docs: add README
1 parent 849eb5f commit 537efbe

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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.

0 commit comments

Comments
 (0)