Skip to main content

Module bytes

Module bytes 

Source
Expand description

Shared byte-slice search over untrusted decode windows.

Empty needles are never a match. That matches the codec helpers this module replaces and avoids memchr’s empty-needle-at-zero behavior.

Functions§

contains
Whether needle occurs in haystack. Empty needles are absent.
find
First offset of needle in haystack, or None when needle is empty.
find_from
First offset of needle at or after from, or None when needle is empty.
find_in
First offset of needle in haystack[start..end], returned as an absolute offset.
find_iter
Offsets of every non-overlapping occurrence of needle.