Module utils

Source

Functionsยง

array_from_slice ๐Ÿ”’
expect_size_of ๐Ÿ”’
Verifies the expected size of type T, for a type that should only grow if absolutely necessary.
first_byte_from_slice ๐Ÿ”’
overflow_error ๐Ÿ”’
Helper for reporting integer overflow errors in a consistent way.
slice_from_slice ๐Ÿ”’
slice_from_slice_at_offset ๐Ÿ”’
Helper to safely slice bytes with offset calculations.
string_from_slice ๐Ÿ”’
Helper to get a &str from a slice at the given offset and range, or an error if it contains invalid UTF-8 data.
try_binary_search_range_by ๐Ÿ”’
Performs a binary search over a range using a fallible key extraction function; a failed key extraction immediately terminats the search.