[−][src]Struct grep_hyperscan::RegexMatcher
An implementation of the Matcher
trait using hyperscan.
Methods
impl RegexMatcher
[src]
pub fn new(patterns: &[String]) -> Result<RegexMatcher, Error>
[src]
Create a new matcher from the given pattern using the default configuration.
Trait Implementations
impl Clone for RegexMatcher
[src]
A thread safe implementation of Clone for our hyperscan RegexMatcher
(1 scratchpad / thread)
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for RegexMatcher
[src]
impl Matcher for RegexMatcher
[src]
type Captures = NoCaptures
The concrete type of capturing groups used for this matcher. Read more
type Error = Error
The error type used by this matcher. Read more
fn find_at(
&self,
haystack: &[u8],
at: usize
) -> Result<Option<Match>, Self::Error>
[src]
&self,
haystack: &[u8],
at: usize
) -> Result<Option<Match>, Self::Error>
Main implementation. Just try to get the current MatchData for the
thread before calling the actual find_at
function.
Note that we don't get the thread data for the scratchpad yet, as we
can still read data from hyperscan result or from the buffered results.
fn new_captures(&self) -> Result<NoCaptures, Self::Error>
[src]
Hyperscan can not match captures, hence the NoCaptures
fn capture_count(&self) -> usize
[src]
fn capture_index(&self, _name: &str) -> Option<usize>
[src]
fn find(&self, haystack: &[u8]) -> Result<Option<Match>, Self::Error>
[src]
fn find_iter<F>(&self, haystack: &[u8], matched: F) -> Result<(), Self::Error> where
F: FnMut(Match) -> bool,
[src]
F: FnMut(Match) -> bool,
fn try_find_iter<F, E>(
&self,
haystack: &[u8],
matched: F
) -> Result<Result<(), E>, Self::Error> where
F: FnMut(Match) -> Result<bool, E>,
[src]
&self,
haystack: &[u8],
matched: F
) -> Result<Result<(), E>, Self::Error> where
F: FnMut(Match) -> Result<bool, E>,
fn captures(
&self,
haystack: &[u8],
caps: &mut Self::Captures
) -> Result<bool, Self::Error>
[src]
&self,
haystack: &[u8],
caps: &mut Self::Captures
) -> Result<bool, Self::Error>
fn captures_iter<F>(
&self,
haystack: &[u8],
caps: &mut Self::Captures,
matched: F
) -> Result<(), Self::Error> where
F: FnMut(&Self::Captures) -> bool,
[src]
&self,
haystack: &[u8],
caps: &mut Self::Captures,
matched: F
) -> Result<(), Self::Error> where
F: FnMut(&Self::Captures) -> bool,
fn try_captures_iter<F, E>(
&self,
haystack: &[u8],
caps: &mut Self::Captures,
matched: F
) -> Result<Result<(), E>, Self::Error> where
F: FnMut(&Self::Captures) -> Result<bool, E>,
[src]
&self,
haystack: &[u8],
caps: &mut Self::Captures,
matched: F
) -> Result<Result<(), E>, Self::Error> where
F: FnMut(&Self::Captures) -> Result<bool, E>,
fn captures_at(
&self,
_haystack: &[u8],
_at: usize,
_caps: &mut Self::Captures
) -> Result<bool, Self::Error>
[src]
&self,
_haystack: &[u8],
_at: usize,
_caps: &mut Self::Captures
) -> Result<bool, Self::Error>
fn replace<F>(
&self,
haystack: &[u8],
dst: &mut Vec<u8>,
append: F
) -> Result<(), Self::Error> where
F: FnMut(Match, &mut Vec<u8>) -> bool,
[src]
&self,
haystack: &[u8],
dst: &mut Vec<u8>,
append: F
) -> Result<(), Self::Error> where
F: FnMut(Match, &mut Vec<u8>) -> bool,
fn replace_with_captures<F>(
&self,
haystack: &[u8],
caps: &mut Self::Captures,
dst: &mut Vec<u8>,
append: F
) -> Result<(), Self::Error> where
F: FnMut(&Self::Captures, &mut Vec<u8>) -> bool,
[src]
&self,
haystack: &[u8],
caps: &mut Self::Captures,
dst: &mut Vec<u8>,
append: F
) -> Result<(), Self::Error> where
F: FnMut(&Self::Captures, &mut Vec<u8>) -> bool,
fn is_match(&self, haystack: &[u8]) -> Result<bool, Self::Error>
[src]
fn is_match_at(&self, haystack: &[u8], at: usize) -> Result<bool, Self::Error>
[src]
fn shortest_match(&self, haystack: &[u8]) -> Result<Option<usize>, Self::Error>
[src]
fn shortest_match_at(
&self,
haystack: &[u8],
at: usize
) -> Result<Option<usize>, Self::Error>
[src]
&self,
haystack: &[u8],
at: usize
) -> Result<Option<usize>, Self::Error>
fn non_matching_bytes(&self) -> Option<&ByteSet>
[src]
fn line_terminator(&self) -> Option<LineTerminator>
[src]
fn find_candidate_line(
&self,
haystack: &[u8]
) -> Result<Option<LineMatchKind>, Self::Error>
[src]
&self,
haystack: &[u8]
) -> Result<Option<LineMatchKind>, Self::Error>
Auto Trait Implementations
impl !RefUnwindSafe for RegexMatcher
impl Send for RegexMatcher
impl Sync for RegexMatcher
impl Unpin for RegexMatcher
impl UnwindSafe for RegexMatcher
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,