Skip to main content

decode

Function decode 

Source
pub fn decode<A: FnMut(u32) -> Option<Atom>>(
    input: &mut &[u8],
    atoms: &mut A,
) -> Result<Value>
Expand description

Decodes one value written by encode or encode_canonical from the front of input, advancing it past the value.

atoms maps an intern token back to its name; pass &mut |t| names.resolve(t) for the run’s Interner, or a caching wrapper.

§Errors

ErrorKind::Codec if input does not start with a valid encoding or names an unknown token. Decoding never panics, whatever the input.