Expand description
§

§v_escape
This crate provides a procedural macro for generating escape functions.
§Example
use v_escape::escape;
escape! {
b'"' -> """,
b'<' -> "<"
}
let s = "Hello,< world!\"";
let escaped = escape_fmt(s).to_string();
assert_eq!(escaped, "Hello,< world!"");
let mut escaped = String::with_capacity(s.len());
escape_string(&s, &mut escaped);
assert_eq!(escaped, "Hello,< world!"");§Features
fmt: Enables theescape_fmtfunction.string: Enables theescape_stringfunction.bytes: Enables theescape_bytesfunction.std: Enables thestdlibrary features.alloc: Enables thealloclibrary features.
§Documentation
- Minimum supported Rust version: 1.85.0 or later
§License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Macros§
- escape
- Generate escape functions from a list of character mappings.
- escape_
builder - A macro for creating a escape functions
Traits§
- Escapes
- A trait that abstracts masking functions for escape sequences.
- Escapes
Builder - A builder trait for creating instances of types that implement the
Escapestrait. - Vector
- A trait for describing vector operations used by vectorized searchers.