read_from_slice

Function read_from_slice 

Source
pub fn read_from_slice(
    data: &[u8],
) -> Result<(u128, usize), DeserializationError>
Expand description

Decodes a number from a slice of bytes when size of encoded number is unknown, returning the number and the number of bytes read.

§Arguments

  • data - slice of bytes to decode number from

§Returns

  • (number, bytes read)