Skip to main content

def_const_type_enum

Macro def_const_type_enum 

Source
macro_rules! def_const_type_enum {
    ($vis:vis $name:ident => $ty:ty {
        $($variant:ident => $val:expr),+
        $(,)?
    }) => { ... };
}
Expand description

define an “enum” (struct) of a singular type

def_const_type_enum! (pub enumName => Type {
    field1 => value,
    field2 => value,
});