Skip to main content

encode

Function encode 

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

Encode a u64 value as a QUIC-style VarInt into buf.

Returns the number of bytes written.

§Errors

  • WireError::BufferTooSmall if buf is not large enough.
  • WireError::InvalidVarInt if value exceeds VARINT_MAX.