Skip to main content

encode_into

Function encode_into 

Source
pub fn encode_into(value: usize, buf: &mut [u8]) -> Result<usize>
Expand description

Encode value as a length_field into buf, returning the bytes written.

Uses the short form for 0..=127, otherwise the minimal long form. Values above 65535 are rejected (Error::LengthTooLarge) per the spec cap.