pub fn decode_u32(buf: &mut ReadBuf<'_>) -> Result<u32>Expand description
Decode a u32 varint from buf.
§Errors
Error::UnexpectedEofifbufis exhausted before the terminator byte.Error::VarintOverflowif the decoded value exceedsu32::MAXor if more thanMAX_LEN_U32bytes are consumed.
§Example
use wire_codec::{varint, ReadBuf};
let mut buf = ReadBuf::new(&[0xAC, 0x02]);
assert_eq!(varint::decode_u32(&mut buf).unwrap(), 300);