rust-hyperscan travis crate docs

Hyperscan is a high-performance regular expression matching library.

Usage

To use, add the following line to Cargo.toml under [dependencies]:

toml hyperscan = "0.1" or alternatively, hyperscan = { git = "https://github.com/flier/rust-hyperscan.git" }

Example

```rust

[macro_use]

extern crate hyperscan;

use hyperscan::*;

fn callback(id: u32, from: u64, to: u64, flags: u32, : &BlockDatabase) -> u32 { asserteq!(id, 0); asserteq!(from, 5); asserteq!(to, 9); assert_eq!(flags, 0);

println!("found pattern #{} @ [{}, {})", id, from, to);

0

}

fn main() { let pattern = &pattern!{"test", flags => HSFLAGCASELESS|HSFLAGSOM_LEFTMOST}; let db: BlockDatabase = pattern.build().unwrap(); let scratch = db.alloc().unwrap();

db.scan::<BlockDatabase>("some test data", 0, &scratch, Some(callback), Some(&db)).unwrap();

} ```