Skip to main content

encode

Function encode 

Source
pub fn encode(value: u64, out: &mut [u8]) -> usize
Expand description

Encode value into out, returning the number of bytes written.

out must be at least MAX_LEN bytes long; this never writes more than that. Panics only via the slice bounds check if out is too short, which is a caller bug — pass a [0u8; varint::MAX_LEN] buffer.