Skip to main content

encode_frame

Function encode_frame 

Source
pub fn encode_frame<C, T>(
    value: &T,
    encoding: Encoding,
) -> Result<Vec<u8>, Status>
where C: Codec<T>,
Expand description

Encode one message as a framed gRPC wire-format buffer: [compressed=flag][len: u32 BE][payload].

encoding == Identity writes a flag-0 frame with the bare codec output. Anything else compresses the codec output with the given codec and writes a flag-1 frame.