Derive Macro glib_macros::Enum

source ·
#[derive(Enum)]
{
    // Attributes available to this derive:
    #[enum_type]
    #[enum_value]
}
Expand description

Derive macro for register a rust enum in the glib type system and derive the the glib::Value traits.

Example

use glib::prelude::*;
use glib::subclass::prelude::*;

#[derive(Debug, Copy, Clone, PartialEq, Eq, glib::Enum)]
#[enum_type(name = "MyEnum")]
enum MyEnum {
    Val,
    #[enum_value(name = "My Val")]
    ValWithCustomName,
    #[enum_value(name = "My Other Val", nick = "other")]
    ValWithCustomNameAndNick,
}