Skip to main content

Crate v_htmlescape

Crate v_htmlescape 

Source
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)SourceReplacement
0x22""
0x26&&
0x27''
0x2F//
0x3C<&lt;
0x3E>&gt;

§Public API

The following functions are emitted, gated by their respective Cargo features (all enabled by default):

FunctionFeatureSignature
escape_stringstringfn(&str, &mut String)
escape_bytesbytesfn(&str, &mut Vec<u8>)
escape_fmtfmtfn(&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.

Functions§

escape_bytes
escape_fmt
escape_string