Skip to main content

encode_into_slice

Function encode_into_slice 

Source
pub fn encode_into_slice<T: NsonSerialize + ?Sized>(
    output: &mut [u8],
    value: &T,
) -> BinaryResult<usize>
Available on crate feature binary only.
Expand description

Encode into a caller-owned slice without codec-owned allocation.

Returns the number of bytes written; Error::BufferTooSmall carries the exact required capacity when output is undersized.