pub fn read_varint(buf: &[u8], pos: usize) -> Result<(u64, usize), WireError>Expand description
Read a varint starting at buf[pos]. Returns (value, new_pos).
ยงErrors
WireError::Truncated if the buffer ends mid-varint;
WireError::VarintOverflow if the encoding exceeds 10 bytes.