Skip to main content

encode_nested_field

Function encode_nested_field 

Source
pub fn encode_nested_field(buf: &mut Vec<u8>, field_id: u64, nested_data: &[u8])
Expand description

Encode a nested field (wire type 2).

Wire layout:

  field_id (varint) │ 2 (varint) │ length (varint) │ nested_data [length]

The nested_data is itself a sequence of TLV fields, pre-encoded by the caller. This enables recursive structures like FileEntry children inside a FileTreeBlock.