macro_rules! define_libfunc_hierarchy {
(pub enum $name:ident $(<
$generic_arg:ident : $generic_arg_first_req:ident $(+ $generic_arg_other_reqs:ident)*
>)? {
$($variant_name:ident ($variant:ty),)*
},
$concrete_name:ident) => { ... };
}
Expand description
Forms a libfunc type from an enum of libfuncs. The new enum implements GenericLibfunc. All the variant types must also implement GenericLibfunc. Usage example:
ⓘ
define_libfunc_hierarchy! {
pub enum MyLibfunc {
LF0(Libfunc0),
LF1(Libfunc1),
}, MyLibfuncConcrete
}