#escaping #simd

v_escape

The simd optimized escaping code

14 releases (6 breaking)

✓ Uses Rust 2018 edition

0.7.0 Feb 14, 2019
0.6.0 Feb 8, 2019
0.5.1 Jan 30, 2019
0.4.0 Jan 10, 2019
0.1.4 Nov 29, 2018

#3 in Hardware support

Download history 60/week @ 2018-11-23 24/week @ 2018-11-30 14/week @ 2018-12-07 24/week @ 2018-12-14 134/week @ 2018-12-21 25/week @ 2018-12-28 397/week @ 2019-01-04 3093/week @ 2019-01-11 3901/week @ 2019-01-18 4833/week @ 2019-01-25 5680/week @ 2019-02-01 6511/week @ 2019-02-08

8,228 downloads per month
Used in 67 crates (3 directly)

MIT/Apache

59KB
1K SLoC

v_escape Documentation Latest version

The simd optimized escape code

Crate v_escape provides a macro new_escape! that define a struct with escaping functionality. These macros are optimized using simd by default, but this can be alter using sub-attributes.

Quick start

In order to use v_escape you will have to call one of the two macros to create a escape struct. In this example, when using the macro new_escape!(MyEscape, "62->bar"); a new a struct MyEscape will be created that every time its method MyEscape::fmt is called will replace all characters ">" with "bar".

#[macro_use]
extern crate v_escape;

new_escape!(MyEscape, "62->bar");

fn main() {
    let s = "foo<bar";
    let escaped = MyEscape::from(s);
    
    print!("{}", escaped);
}

To check if rust version has simd functionality. The following code has to be added to file build.rs.

use v_escape::check_version;

fn main() {
    check_version();
}

Dependencies

~1.5MB
~33K SLoC

  • build build.rs