macro_rules! field {
($o:ident::$e:ident) => { ... };
($o:ident::$e:expr) => { ... };
}
Expand description
Convenience macro, so that we don’t have to write
ⓘ
let field_f = <StructWithNamedFields as TasmStruct>::get_field!("f");
let field_0 = <StructWithUnnamedFields as TasmStruct>::get_field!("field_0");
but instead
ⓘ
let field_f = field!(StructWithNamedFields::f);
let field_0 = field!(StructWithUnnamedFields::0);
.
Limitations The type descriptor cannot have generic type arguments. To get around
this, define a new type via type Custom = Generic<T>
and use that instead.