Expand description
Helpers for reading, validating, and sizing encoded values.
Functionsยง
- at_
least - Checks if the buffer has at least
lenbytes remaining. Returns an Error::EndOfBuffer if not. - at_
least_ items - Checks if the buffer has at least
len * item_sizebytes remaining, treating multiplication overflow as insufficient. Returns an Error::EndOfBuffer if not. - ensure_
zeros - Ensures the next
sizebytes are all zeroes in the provided buffer, returning an Error otherwise. - max_
items_ size - Returns an upper bound on the encoded size of a
Vecor other length-prefixed sequence oflenitems that each encode to at mostitem_sizebytes, with the length prefix at its widest. - read_
fixed_ vec - Reads
lenvalues of a FixedSize type from the buffer into a vector.