javelin_pattern/lib.rs
1//! Rust bindings to [Jeffrey Lim's JavelinPattern](https://github.com/jthlim/JavelinPattern).
2//!
3//! The [`bytes`] module matches byte slices and reports byte offsets. Compilation
4//! is fallible; matching and scanning follow the native engine's semantics.
5//!
6//! ```
7//! use javelin_pattern::bytes::Regex;
8//!
9//! let re = Regex::new(r"(\w+)=(\d+)")?;
10//! let captures = re.captures(b"answer=42").unwrap();
11//! assert_eq!(captures.get(1).unwrap().as_bytes(), b"answer");
12//! assert_eq!(captures.get(2).unwrap().as_bytes(), b"42");
13//! # Ok::<(), javelin_pattern::Error>(())
14//! ```
15
16#![deny(missing_docs, unsafe_op_in_unsafe_fn)]
17
18pub mod bytes;
19mod error;
20mod ffi;
21
22pub use error::Error;