Macro aframe::simple_enum

source ·
macro_rules! simple_enum {
    ($(#[$outer:meta])* $name:ident $(, $variant:ident => $s:literal)*) => { ... };
}
Expand description

Defines an enum in which each variant maps to a single string (via a Display implementation). This can be combined with component_def! to crate fields with a limited number of possiblities.

// For example:
use aframe::simple_enum;
 
simple_enum!
(Autoplay, 
    Null => "null", 
    True => "true", 
    False => "false"
);
component_struct!
(Animation,
    // ...
    autoplay: "autoplay" Autoplay = Autoplay::Null,
    // ...
);