pub fn encode(
input: Input<'_>,
metadata: &mut [u8],
staging: &mut [u8],
scratch: &mut Scratch<'_>,
output: &mut [u8],
envelope: Limits,
shared: Limits,
limits: Limits,
) -> Result<usize, Error>Expand description
Build into caller-owned metadata/staging, re-admit with production reader, then copy to final output. Every error leaves final output unchanged. Scratch may change.