Skip to main content

encode_probe_response

Function encode_probe_response 

Source
pub fn encode_probe_response(
    resp: &ProbeResponse,
    ext: Option<&ProbeResponseExt>,
) -> Result<Vec<u8>, Error>
Expand description

Encode a ProbeResponse with its optional trailing ProbeResponseExt (ADR 013 §Tier 1, two-phase).

The base message and the extension are encoded as two adjacent postcard values in one frame. Encoding them separately is what makes a future field appended to ProbeResponseExt invisible to an older receiver, which stops consuming at the end of the base and discards the rest.

§Errors

Propagates a postcard::Error if serialization fails.