Skip to main content

render_as_bytes

Function render_as_bytes 

Source
pub fn render_as_bytes(
    data: &[u8],
    opts: RenderOpts,
) -> Result<Vec<u8>, CodecError>
Expand description

Encode a textual prototext payload back to raw protobuf binary wire bytes.

When opts.assume_binary is true, or the input does not carry the #@ prototext: header, the bytes are returned unchanged (pass-through). When the input carries the header, it is decoded from text to binary.