encode_frame

Function encode_frame 

Source
pub fn encode_frame<T: Serialize>(value: &T) -> Result<Vec<u8>>
Expand description

Serialize a value to postcard bytes.

Symmetric with decode_frame: decode_frame(encode_frame(v)) == v.

The returned bytes are suitable for BusServer::publish(), internal channel transport, and as input to write_frame() for socket I/O.

ยงErrors

Returns an error if postcard serialization fails.