1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
mod regex;
use std::ops::Range;
pub use regex::Regex;
#[derive(Debug)]
pub struct Capture<'a, I> {
input: &'a [I],
pub range: Range<usize>,
}
impl<'a, I> Capture<'a, I> {
pub fn values(&self) -> &'a [I] {
&self.input[self.range.clone()]
}
}
pub trait CompiledRegex<I> {
fn is_full_match(&self, input: &[I]) -> bool;
fn captures<'a>(&self, input: &'a [I]) -> Option<Vec<Capture<'a, I>>>;
}