pub struct ExcludeMatcher { /* private fields */ }Expand description
A compiled exclude matcher: a path is excluded when the (extended) regex
matches anywhere in it, mirroring grep -E -v.
Implementations§
Source§impl ExcludeMatcher
impl ExcludeMatcher
Sourcepub fn new(pattern: &str) -> Result<Self, ExcludeError>
pub fn new(pattern: &str) -> Result<Self, ExcludeError>
Compiles an already-expanded extended-regex exclude pattern.
§Errors
Returns ExcludeError::InvalidRegex if pattern is not a valid
extended regular expression.
Sourcepub fn is_excluded(&self, path: &str) -> bool
pub fn is_excluded(&self, path: &str) -> bool
Returns true when path is excluded (the regex matches anywhere in
it), matching grep -E -v’s “drop matching lines” semantics.
Trait Implementations§
Source§impl Clone for ExcludeMatcher
impl Clone for ExcludeMatcher
Source§fn clone(&self) -> ExcludeMatcher
fn clone(&self) -> ExcludeMatcher
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 ExcludeMatcher
impl RefUnwindSafe for ExcludeMatcher
impl Send for ExcludeMatcher
impl Sync for ExcludeMatcher
impl Unpin for ExcludeMatcher
impl UnsafeUnpin for ExcludeMatcher
impl UnwindSafe for ExcludeMatcher
Blanket Implementations§
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