Skip to main content

encode_json_envelope

Function encode_json_envelope 

Source
pub fn encode_json_envelope<T: Serialize>(
    kind: &str,
    format_version: u32,
    supported_version: u32,
    payload_checksum: &str,
    payload: &T,
) -> Result<Vec<u8>, EnvelopeCodecError>
Expand description

Encodes one JSON-bodied envelope, validating that the recorded version is what this build writes for kind and that the recorded checksum still matches the payload.