cairo_lang_sierra

Macro define_type_hierarchy

Source
macro_rules! define_type_hierarchy {
    (pub enum $name:ident { $($variant_name:ident ($variant:ty),)* },
    $concrete_name:ident) => { ... };
}
Expand description

Forms a Sierra type used by extensions type from an enum of such types. The new enum implements GenericType. All the variant types must also implement GenericType. Usage example:

define_type_hierarchy! {
    pub enum MyType {
      Ty0(Type0),
      Ty1(Type1),
    }, MyTypeConcrete
}