Expand description
Byte-slice helpers that complement bytes::Bytes and String.
The C struct string is a length-tagged byte view (uint8_t* plus
uint32_t). The Rust port replaces it with bytes::Bytes for
shared ownership of message payloads and String for textual
data. This module collects the small handful of helpers downstream
stages reach for: a stripped-down string_compare (length-prefixed
byte ordering) and char-finding wrappers that operate on slices.
Functionsยง
- eq_
ignore_ ascii_ case - Case-insensitive ASCII slice equality. Slices of different lengths are unequal.
- strchr
- Return the byte index of the first occurrence of
needleinhaystack, orNoneif absent. - string_
compare - Compare two byte slices using the same rule as the C
string_compare: shorter slices sort first, otherwise sort lexicographically. - strrchr
- Return the byte index of the last occurrence of
needleinhaystack, orNoneif absent.