Skip to main content

Module util

Module util 

Source
Expand description

Codec utility functions

Functionsยง

at_least
Checks if the buffer has at least len bytes remaining. Returns an Error::EndOfBuffer if not.
at_least_items
Checks if the buffer has at least len * item_size bytes remaining, treating multiplication overflow as insufficient. Returns an Error::EndOfBuffer if not.
ensure_zeros
Ensures the next size bytes are all zeroes in the provided buffer, returning an Error otherwise.
read_fixed_vec
Reads len values of a FixedSize type from the buffer into a vector.