Macro fuel_types::mem_layout
source · macro_rules! mem_layout { () => { ... }; (@accum () -> ($s:ident for $o:ident $($f:ident: $t:ty = $si:expr, $a:expr);*) -> ($($addr:tt)*)) => { ... }; (@accum ($field:ident: $t:ty = $size:expr, $($tail:tt)*) -> ($s:ident for $o:ident $($f:ident: $typ:ty = $si:expr, $a:expr);*) -> ($($addr:tt)*)) => { ... }; (@as_expr ($s:ident $o:ident $($field:ident, $size:expr, $t:ty, $addr:expr)+) -> ($($len:tt)*)) => { ... }; ($s:ident for $o:ident $field:ident: $t:ty = $size:expr, $($tail:tt)*) => { ... }; }
Expand description
Defines a memory layout for a type.
The address starts at 0 and is incremented by the size of each field.
The syntax is field_name: field_type = field_size_in_bytes, ...
.