Closed A1-Triard closed 4 years ago
For example, the associated constants can be generated by widely used bitflags crate:
bitflags! { pub struct SomeFlags: u64 { const PERSISTENT = 0x40000000000; const BLOCKED = 0x200000000000; const DELETED = 0x2000000000; } } fn main() { println!("There is some flag with '{}' name.", name_of!(const PERSISTENT in SomeFlags)); }
Looks good, thanks! I merged it and bumped up the version on crates.io.
Cheers
For example, the associated constants can be generated by widely used bitflags crate: