Skip to main content

Crate v_latexescape

Crate v_latexescape 

Source
Expand description

autogenerated by v_escape_codegen@0.2.1

§v_latexescape

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
0x23#\#
0x24$\$
0x25%\%
0x26&\&
0x5C\\textbackslash{}
0x5E^\textasciicircum{}
0x5F_\_
0x7B{\{
0x7D}\}
0x7E~\textasciitilde{}

§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