Expand description
This project provides derive implementation for the enumx crate .
See enumx README for more.
Macros§
Enum!( Type0, Type1, ..., TypeM )
denotes a predefined enum, the definition of which looks like:- defines enums, with the syntax support of
Attribute Macros§
- tag an
fn
with#[enumx]
to enable “type pattern matching” inmatch
expressions that are tagged with#[ty_pat]
/#[ty_pat(gen_variants)]/
#[ty_pat(gen A,B,..)]`. - collects all returned values in exit branches of the function, into an enum type, returning an
impl
trait - To translate the
expr?
expressions in a different manner than the Rust’s default:
Derive Macros§
- derives
enumx::Exchange
trait for custom definedenum
s - Derives the trait
enumx::FromVariant
for user defined enum types. - Since
enum
s in Rust do not have prototypes, this macro derives them.