pub struct ErrorKeywordMatcher { /* private fields */ }Expand description
Literal and regular-expression text matcher.
Implementations§
Source§impl ErrorKeywordMatcher
impl ErrorKeywordMatcher
Sourcepub fn with_keywords(keywords: Vec<&str>) -> Self
pub fn with_keywords(keywords: Vec<&str>) -> Self
Creates a matcher from literal strings.
Sourcepub fn with_patterns(patterns: Vec<&str>) -> Result<Self, String>
pub fn with_patterns(patterns: Vec<&str>) -> Result<Self, String>
Creates a matcher from regular expressions.
Sourcepub fn with_keywords_and_patterns(
keywords: Vec<&str>,
patterns: Vec<&str>,
) -> Result<Self, String>
pub fn with_keywords_and_patterns( keywords: Vec<&str>, patterns: Vec<&str>, ) -> Result<Self, String>
Creates a matcher from literals and regular expressions.
Sourcepub fn is_match(&self, text: &str) -> bool
pub fn is_match(&self, text: &str) -> bool
Returns whether any configured literal or expression matches text.
Sourcepub fn match_count(&self, text: &str) -> usize
pub fn match_count(&self, text: &str) -> usize
Counts configured literals and expressions that match text.
Trait Implementations§
Source§impl Clone for ErrorKeywordMatcher
impl Clone for ErrorKeywordMatcher
Source§fn clone(&self) -> ErrorKeywordMatcher
fn clone(&self) -> ErrorKeywordMatcher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ErrorKeywordMatcher
impl RefUnwindSafe for ErrorKeywordMatcher
impl Send for ErrorKeywordMatcher
impl Sync for ErrorKeywordMatcher
impl Unpin for ErrorKeywordMatcher
impl UnsafeUnpin for ErrorKeywordMatcher
impl UnwindSafe for ErrorKeywordMatcher
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more