pub struct FileFilter { /* private fields */ }Expand description
A compiled pair of include/exclude glob sets for filtering file entries by relative path.
- An empty
includesset matches everything. - A file passes the filter when it matches the include rules (or there are none) and does not match any exclude rule.
Implementations§
Source§impl FileFilter
impl FileFilter
Sourcepub fn new<P>(includes: &[P], excludes: &[P]) -> Result<Self, Error>
pub fn new<P>(includes: &[P], excludes: &[P]) -> Result<Self, Error>
Creates a filter from include and exclude pattern lists.
§Errors
Returns an error if any pattern is invalid.
Sourcepub fn matches(&self, path: &str) -> bool
pub fn matches(&self, path: &str) -> bool
Returns true if the given relative path passes the filter.
A path passes when it is included (or no include rules are set) and it is not excluded.
Sourcepub fn is_accept_all(&self) -> bool
pub fn is_accept_all(&self) -> bool
Returns true if this filter accepts all files
(no include and no exclude rules).
Trait Implementations§
Source§impl Clone for FileFilter
impl Clone for FileFilter
Source§fn clone(&self) -> FileFilter
fn clone(&self) -> FileFilter
Returns a duplicate of the value. Read more
1.0.0 · 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 FileFilter
impl RefUnwindSafe for FileFilter
impl Send for FileFilter
impl Sync for FileFilter
impl Unpin for FileFilter
impl UnsafeUnpin for FileFilter
impl UnwindSafe for FileFilter
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