Skip to main content

decode_into

Function decode_into 

pub fn decode_into<B>(
    input: impl AsRef<[u8]>,
    output: &mut B,
) -> Result<&mut [u8], DecodeError>
where B: AsMut<[u8]> + ?Sized,
Expand description

Decode into an existing slice-like buffer, returning its written portion.

Extra capacity is left untouched; this never grows a vector. Malformed input or insufficient capacity leaves the entire destination unchanged.