read_vint

Function read_vint 

Source
pub fn read_vint(buffer: &[u8]) -> Result<Option<(u64, usize)>, ToolError>
Expand description

Reads a vint from the beginning of the input array slice.

This method returns an option with the None variant used to indicate there was not enough data in the buffer to completely read a vint.

The returned tuple contains the value of the vint (u64) and the length of the vint (usize). The length will be less than or equal to the length of the input slice.

ยงErrors

This method can return a ToolError if the input array cannot be read as a vint.