cairo_lang_sierra

Macro define_concrete_libfunc_hierarchy

source
macro_rules! define_concrete_libfunc_hierarchy {
    (pub enum $name:ident $(<
        $generic_arg:ident : $generic_arg_first_req:ident $(+ $generic_arg_other_reqs:ident)*
    >)? {
        $($variant_name:ident ($variant:ty),)*
    }) => { ... };
}
Expand description

Forms a concrete library function type from an enum of library calls. The new enum implements ConcreteLibfunc. All the variant types must also implement ConcreteLibfunc. Usage example:

define_concrete_libfunc_hierarchy! {
    pub enum MyLibfunc {
      LF0(Libfunc0),
      LF1(Libfunc1),
    }
}