#escaping #simd

v_escape

The simd optimized escaping code

16 releases (6 breaking)

✓ Uses Rust 2018 edition

0.7.2 Mar 7, 2019
0.7.1 Feb 28, 2019
0.6.0 Feb 8, 2019
0.5.1 Jan 30, 2019
0.1.4 Nov 29, 2018

#12 in Hardware support

Download history 127/week @ 2018-12-20 16/week @ 2018-12-27 123/week @ 2019-01-03 2862/week @ 2019-01-10 3526/week @ 2019-01-17 4753/week @ 2019-01-24 5482/week @ 2019-01-31 6423/week @ 2019-02-07 7721/week @ 2019-02-14 7831/week @ 2019-02-21 8196/week @ 2019-02-28 9343/week @ 2019-03-07 9637/week @ 2019-03-14 8532/week @ 2019-03-21 9447/week @ 2019-03-28

28,156 downloads per month
Used in 82 crates (3 directly)

MIT/Apache

62KB
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
~31K SLoC

  • build build.rs