decode_u128_varint

Function decode_u128_varint 

Source
pub const fn decode_u128_varint(
    buf: &[u8],
) -> Result<(usize, u128), DecodeVarintError>
Expand description

Decodes a value from LEB128 variable length format.

§Arguments

  • buf - A byte slice containing the LEB128 encoded value.

§Returns

  • Returns the bytes readed and the decoded value as u128 if successful.

  • Returns DecodeVarintError if the buffer did not contain a valid LEB128 encoding or the decode buffer did not contain enough bytes to decode a value.