#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

#5 in Hardware support

Download history 8928/week @ 2019-04-28 9273/week @ 2019-05-05 11918/week @ 2019-05-12 9870/week @ 2019-05-19 11355/week @ 2019-05-26 13703/week @ 2019-06-02 11836/week @ 2019-06-09 8689/week @ 2019-06-16 7853/week @ 2019-06-23 7469/week @ 2019-06-30 7361/week @ 2019-07-07 7315/week @ 2019-07-14 7070/week @ 2019-07-21 7743/week @ 2019-07-28 8584/week @ 2019-08-04

39,554 downloads per month
Used in 89 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 alter using sub-attributes.

Documentation

Example

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);
}

Dependencies

~1.5MB
~33K SLoC