encode

Function encode 

Source
pub fn encode(
    schema_id: u64,
    payload: &[u8],
    out: &mut BytesMut,
) -> Result<(), Error>
Expand description

Appends an envelope around payload to out.

Fails with Error::TooLarge if payload is longer than i32::MAX bytes; out is left untouched in that case.