Expand description
autogenerated by v_escape_codegen@0.2.1
§v_htmlescape
Autogenerated escape crate produced by
v_escape_codegen on top of the
v_escape-base runtime.
§Behavior
Each call rewrites the characters listed in the table below into their
replacement string; every other byte of the input is forwarded verbatim.
All public entry points take a &str (UTF-8 guaranteed at the type level),
so they cannot be used to construct invalid UTF-8.
§Escape table
| Byte (hex) | Source | Replacement |
|---|---|---|
0x22 | " | " |
0x26 | & | & |
0x27 | ' | ' |
0x2F | / | / |
0x3C | < | < |
0x3E | > | > |
§Public API
The following functions are emitted, gated by their respective Cargo features (all enabled by default):
| Function | Feature | Signature |
|---|---|---|
escape_string | string | fn(&str, &mut String) |
escape_bytes | bytes | fn(&str, &mut Vec<u8>) |
escape_fmt | fmt | fn(&str) -> impl Display + '_ |
At runtime the implementation dispatches to the best SIMD backend
available on the current CPU (AVX2/SSE2 on x86_64, NEON on aarch64,
simd128 on wasm32) and falls back to a scalar loop otherwise.