Crate enumx_derive[][src]

This project provides derive implementation for the enumx crate .

See enumx README for more.

Macros

Enum

Enum!( Type0, Type1, ..., TypeM ) denotes a predefined enum, the definition of which looks like:

def_impls

defines enums, with the syntax support of

Attribute Macros

enumx

tag an fn with #[enumx] to enable "type pattern matching" in match expressions that are tagged with #[ty_pat]/#[ty_pat(gen_variants)]/#[ty_pat(gen A,B,..)]`.

sum

collects all returned values in exit branches of the function, into an enum type, returning an impl trait

sum_err

To translate the expr? expressions in a different manner than the Rust's default:

Derive Macros

Exchange

derives enumx::Exchange trait for custom defined enums

FromVariant

Derives the trait enumx::FromVariant for user defined enum types.

Proto

Since enums in Rust do not have prototypes, this macro derives them.