macro_rules! field_with_size {
{ $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 TasmObject>::get_field_with_size!("f");
let field_0 = <StructWithUnnamedFields as TasmObject>::get_field_with_size!("field_0");
but instead
ⓘ
let field_f = field_with_size!(StructWithNamedFields::f);
let field_0 = field_with_size!(StructWithUnnamedFields::0);
and for numbered fields.
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.