Expand description
Shared byte-slice utilities for the Mago toolchain.
PHP source code is binary-safe, so the toolchain handles identifiers, comments, and
string literals as &[u8] end-to-end. Diagnostic messages and human-facing logs are
UTF-8 strings, so a tiny adapter layer is needed at the display boundary. This crate
is that adapter, plus a few SIMD-accelerated byte-trimming primitives.
Structs§
- Bytes
Display - Renders a byte slice as text for diagnostic messages.
Functions§
- trim_
byte - Strips all leading and trailing occurrences of
bytefroms. - trim_
end_ byte - Strips all trailing occurrences of
bytefroms. - trim_
start_ byte - Strips all leading occurrences of
bytefroms. - write_
escaped - Writes
bytestof, rendering valid UTF-8 verbatim and every byte that is not part of a valid UTF-8 sequence as a\xHHhex escape.