#escaping #simd

v_escape

The simd optimized escaping code

12 releases (4 breaking)

✓ Uses Rust 2018 edition

0.7.4 Aug 11, 2019
0.7.2 Mar 7, 2019
0.3.2 Dec 27, 2018
0.1.4 Nov 29, 2018

#6 in Hardware support

Download history 7873/week @ 2019-07-30 8770/week @ 2019-08-06 9866/week @ 2019-08-13 8810/week @ 2019-08-20 6381/week @ 2019-08-27 6816/week @ 2019-09-03 6105/week @ 2019-09-10 6283/week @ 2019-09-17 7279/week @ 2019-09-24 5999/week @ 2019-10-01 6145/week @ 2019-10-08 6103/week @ 2019-10-15 5479/week @ 2019-10-22 5486/week @ 2019-10-29 5920/week @ 2019-11-05

39,554 downloads per month
Used in 94 crates (3 directly)

MIT/Apache

59KB
1K SLoC

v_escape Documentation Latest version Build Status

The simd optimized escape code

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

Documentation

Example

In order to use v_escape you will have to call one of the two macros to create an 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);
}

Dependencies

~1.5MB
~33K SLoC