pub struct PatternMatcher { /* private fields */ }Expand description
Pattern matcher with configurable patterns
Implementations§
Source§impl PatternMatcher
impl PatternMatcher
pub fn new(config: Arc<Config>) -> Self
Sourcepub fn is_temp_directory(&self, name: impl AsRef<OsStr>) -> bool
pub fn is_temp_directory(&self, name: impl AsRef<OsStr>) -> bool
Check if a directory name matches any temp directory pattern
Sourcepub fn is_temp_file(&self, name: impl AsRef<OsStr>) -> bool
pub fn is_temp_file(&self, name: impl AsRef<OsStr>) -> bool
Check if a file name matches any temp file pattern
Sourcepub fn matches(&self, path: &Path, is_dir: bool) -> bool
pub fn matches(&self, path: &Path, is_dir: bool) -> bool
Check if path component matches any temp pattern
Sourcepub fn directory_patterns(&self) -> &[String]
pub fn directory_patterns(&self) -> &[String]
Get directory patterns for display
Sourcepub fn file_patterns(&self) -> &[String]
pub fn file_patterns(&self) -> &[String]
Get file patterns for display
pub fn config(&self) -> Arc<Config> ⓘ
Auto Trait Implementations§
impl Freeze for PatternMatcher
impl RefUnwindSafe for PatternMatcher
impl Send for PatternMatcher
impl Sync for PatternMatcher
impl Unpin for PatternMatcher
impl UnsafeUnpin for PatternMatcher
impl UnwindSafe for PatternMatcher
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more