Structsยง
- Match
Pattern ๐
Enumsยง
Functionsยง
- derive_
enum_ variant_ method - Generic helper for
EnumIsAandEnumAsGetters. This generates one function per variant. - derive_
variant_ index_ arity - Macro to derive a function
fn variant_index_arity(&self) -> (u32, usize)the pair (variant index, variant arity). Only works on enumerations, of course. - derive_
variant_ name - Macro to derive a function
fn variant_name(&self) -> Stringprinting the constructor of an enumeration. Only works on enumerations, of course. - generate_
variant_ ๐match_ patterns - Generate matching patterns for an enumeration.
- to_
snake_ ๐case - We initially used the convert-case crate, but it converts names like โI32โ to โi_32โ, while we want to get โi32โ. We thus reimplemented our own converter (which removes one dependency at the same time).