Skip to main content

encode_payload

Function encode_payload 

Source
pub fn encode_payload(message: &Message, buffer: Vec<u8>) -> Result<Vec<u8>>
Expand description

Appends the Postcard encoding of message to buffer and returns it.

The length header is not written and MAX_PAYLOAD_LEN is not enforced: both belong to the framing layer.

ยงErrors

Returns io::ErrorKind::InvalidData if Postcard serialization fails.