Skip to main content

Module encode

Module encode 

Source
Expand description

Encode a ZCP envelope to wire bytes.

Two encoding paths:

  • encode_to_slice — write into a caller-provided &mut [u8]. Works on no_std with no allocator. Returns the number of bytes written.

  • encode_to_vec — allocate and return a Vec<u8>. Requires the alloc feature.

Structs§

EnvelopeFields
Parameters for encoding a single ZCP envelope.

Functions§

encode_to_slice
Encode an envelope into a pre-allocated byte slice.
encode_to_vecalloc
Encode an envelope and return an owned Vec<u8>.