pub struct DcPattern { /* private fields */ }Expand description
A compiled dc-glob pattern for repeated path-matching without filesystem traversal.
Unlike the free-function debug_matches, this compiles the pattern once and can be
reused efficiently across many paths.
Implementations§
Source§impl DcPattern
impl DcPattern
Sourcepub fn new(pattern: &str) -> Result<Self>
pub fn new(pattern: &str) -> Result<Self>
Compile a glob pattern. Returns an error if the pattern is invalid.
Sourcepub fn with_ignore_case(pattern: &str) -> Result<Self>
pub fn with_ignore_case(pattern: &str) -> Result<Self>
Compile a glob pattern with case-insensitive matching (ASCII only).
Sourcepub fn matches_path(&self, path: &Path) -> bool
pub fn matches_path(&self, path: &Path) -> bool
Return true if the given path matches this pattern.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DcPattern
impl RefUnwindSafe for DcPattern
impl Send for DcPattern
impl Sync for DcPattern
impl Unpin for DcPattern
impl UnsafeUnpin for DcPattern
impl UnwindSafe for DcPattern
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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