/enumber

Rust enumerations with numerical values

Primary LanguageRustBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

enumber

BSD 3 Clause Main build status Latest docs Crates.IO

enumber is a procedural macro crate which helps you to work with enums whose purpose it is to represent numbers (for example when parsing complex binary logs) or strange wire protocols.

#[enumber::convert]
pub enum Flags {
    EnableCompression = 1,
    EnableTLS = 2,
    Other(usize),
}