# rust-hyperscan **Repository Path**: mirrors_minio/rust-hyperscan ## Basic Information - **Project Name**: rust-hyperscan - **Description**: Hyperscan bindings for Rust with Multiple Pattern and Streaming Scan - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-09 - **Last Updated**: 2025-10-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # rust-hyperscan [![travis](https://api.travis-ci.org/flier/rust-hyperscan.svg)](https://travis-ci.org/flier/rust-hyperscan) [![crate](https://img.shields.io/crates/v/hyperscan.svg)](https://crates.io/crates/hyperscan) [![docs](https://docs.rs/hyperscan/badge.svg)](https://docs.rs/crate/hyperscan/) [Hyperscan](https://github.com/01org/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 { assert_eq!(id, 0); assert_eq!(from, 5); assert_eq!(to, 9); assert_eq!(flags, 0); println!("found pattern #{} @ [{}, {})", id, from, to); 0 } fn main() { let pattern = &pattern!{"test", flags => HS_FLAG_CASELESS|HS_FLAG_SOM_LEFTMOST}; let db: BlockDatabase = pattern.build().unwrap(); let scratch = db.alloc().unwrap(); db.scan::("some test data", 0, &scratch, Some(callback), Some(&db)).unwrap(); } ```