macro_rules! read_value_offset_length {
(
$input: ident,
$start_pos: ident,
$get_full_field_info: ident,
$struct_enum: ident,
$var: ident,
$var_type: ident,
$nom_fn: ident
) => { ... };
}Expand description
This macro generates code which uses nom to read the specified data at the current $input. If $get_full_field_info is true, it will also determine the offset into the current buffer and the length of the data and generate the appropriate FieldTrait (FieldFull or FieldLight) object. Finally it will set the field in $struct_enum. Note that the value is made available outside of the macro in $var to ensure that the calling code has access to it for additional processing. Ex: read_value_offset_length! { input, start_pos_ptr, get_full_field_info, detail_enum, key_node_flag_bits, u16, le_u16 }