vu128

Function encode_i64

Source
pub fn encode_i64(buf: &mut [u8; 9], value: i64) -> usize
Expand description

Encodes an i64 into a buffer, returning the encoded length.

The contents of the buffer beyond the returned length are unspecified.

ยงExamples

let mut buf = [0u8; 9];
let encoded_len = vu128::encode_i64(&mut buf, 123);
assert_eq!(&buf[..encoded_len], &[0xB6, 0x03]);