Skip to main content

render_as_text

Function render_as_text 

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

Decode a raw protobuf binary payload and render it as protoc-style text.

When opts.assume_binary is false and the data already carries the #@ prototext: header, it is first encoded back to binary so that the schema-aware decoder can re-render it (e.g. with a different schema or annotation settings). With assume_binary: true the data is always treated as raw binary wire bytes.