Skip to main content

encode

Function encode 

Source
pub fn encode<T: Serialize>(
    protocol: ProtocolVersion,
    kind: MessageKind,
    value: &T,
) -> Result<Vec<u8>, CodecError>
Expand description

Encodes a serializable value as a checksummed Postcard Aequora frame.

§Errors

Returns CodecError when Postcard serialization fails or the payload cannot fit in the frame’s 32-bit length field.