pub struct IgnoreRules { /* private fields */ }Expand description
A chain of matchers, one per directory that contributed rules. Deeper directories win,
which is what .gitignore nesting means.
Implementations§
Source§impl IgnoreRules
impl IgnoreRules
Sourcepub fn for_root(
fs: &dyn FileSystemService,
root: &Path,
options: IgnoreOptions,
) -> Self
pub fn for_root( fs: &dyn FileSystemService, root: &Path, options: IgnoreOptions, ) -> Self
Build the root-level rules, reading ignore files through fs.
pub fn options(&self) -> IgnoreOptions
Sourcepub fn load_dir(&mut self, fs: &dyn FileSystemService, dir: &Path)
pub fn load_dir(&mut self, fs: &dyn FileSystemService, dir: &Path)
Read dir’s own ignore files, if it has any we have not already loaded.
Called before listing each directory, so nesting is honoured lazily: we only pay for the rules of directories the user actually opened.
Whether path should be hidden from the explorer.
Sourcepub fn is_ignored(&self, path: &Path, is_dir: bool) -> bool
pub fn is_ignored(&self, path: &Path, is_dir: bool) -> bool
Whether an ignore file matches path. Deepest matcher wins; an explicit
whitelist (!pattern) at that depth un-ignores it.
Sourcepub fn filter(&self, entries: Vec<DirEntryInfo>) -> Vec<DirEntryInfo>
pub fn filter(&self, entries: Vec<DirEntryInfo>) -> Vec<DirEntryInfo>
Drop the entries the explorer should not show.
pub fn root(&self) -> &Path
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IgnoreRules
impl RefUnwindSafe for IgnoreRules
impl Send for IgnoreRules
impl Sync for IgnoreRules
impl Unpin for IgnoreRules
impl UnsafeUnpin for IgnoreRules
impl UnwindSafe for IgnoreRules
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