Skip to main content

Module utils

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 ๐Ÿ”’
fits_precision ๐Ÿ”’
overflow_error ๐Ÿ”’
Helper for reporting integer overflow errors in a consistent way.
parse_in_bracket ๐Ÿ”’
Parse [digits | field] starting at i (which points to [). Returns (VariantPathElement, position after ]).
parse_path ๐Ÿ”’
Parse a path string into a vector of VariantPathElement.
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.