settings

Macro generate_inspect

Source
macro_rules! generate_inspect {
    (@underscore $_type:ty) => { ... };
    ($(#[$metas:meta])* pub enum $name:ident {
        $(
            $(#[$variant_meta:meta])*
            $variant:ident
            $( ($($data:ty),+ $(,)?) )?
        ),* $(,)?
    }
    ) => { ... };
}
Expand description

This macro takes an enum, which has variants associated with various numbers of data, and generates the same enum and implements a for_inspect method. The for_inspect method returns variants’ names.