Crate enumx_derive

Source
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” in match 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 defined enums
  • Derives the trait enumx::FromVariant for user defined enum types.
  • Since enums in Rust do not have prototypes, this macro derives them.