[−][src]Function sqlite_varint::read_varint
pub fn read_varint(bytes: &[u8]) -> (i64, usize)
Reads a slice of bytes from the start assuming it is a varint. Gives back the varint as i64 and the amount of bytes the varint was big.
Example
use sqlite_varint::read_varint; // Small positive integer values take little place assert_eq!((1, 1), read_varint(&vec![0b00000001])); // Negative values will always take 9 bytes. // Note that the vector is 10 bytes long. assert_eq!((-1, 9), read_varint(&vec![0xff; 10]));