pub enum Filter<'a> {
Show 13 variants
AllPaths,
All(&'a [Filter<'a>]),
Any(&'a [Filter<'a>]),
IgnoredDirNames {
names: &'a [&'a str],
case: Case,
},
IgnoredFileExts {
exts: &'a [&'a str],
case: Case,
files_without_extension: bool,
},
IgnoredFileNames {
names: &'a [&'a str],
case: Case,
},
NonSymlinkFiles,
SameDevice {
device_id: u64,
},
SomeDirNames {
names: &'a [&'a str],
case: Case,
},
SomeFileExts {
exts: &'a [&'a str],
case: Case,
files_without_extension: bool,
},
SomeFileNames {
names: &'a [&'a str],
case: Case,
},
SymlinkFiles,
UserDefined {
accept: fn(&Path) -> Box<dyn Future<Output = bool> + Unpin>,
},
}Variants§
AllPaths
§A filter that accepts all paths
All(&'a [Filter<'a>])
§A filter that combines all filters you provide, using logical conjunction
§Notes
- If you provide an empty list, this filter rejects all paths.
- Files are only accepted if all filters accept them.
Any(&'a [Filter<'a>])
§A filter that combines all filters you provide, using logical disjunction
§Notes
- If you provide an empty list, this filter rejects all paths.
- Files are accepted if any of the filters accepts them.
IgnoredDirNames
§A filter that ignores directories by names you provide
§Notes
Providing an empty list means no names are ignored. So all directories will be accepted.
IgnoredFileExts
§A filter that ignores files by extensions you provide
§Notes
If you provide an empty list, that means no extensions are ignored, so all files having extension will be accepted.
Fields
IgnoredFileNames
§A filter that ignores files by names you provide
§Notes
Providing an empty list means no names are ignored. So all files will be accepted.
NonSymlinkFiles
§A filter that rejects symbolic link files
SameDevice
§Same Device filter
A filter which only accepts files on a same device of a file you provide.
SomeDirNames
§A filter that only accepts directories by names you provide
§Notes
Providing an empty list means you have no names to accept. So all directories will be ignored.
SomeFileExts
§A filter that only accepts files by extensions you provide
§Notes
Providing an empty list means you have nothing to pick. So all files having extension will be ignored.
Fields
SomeFileNames
§A filter that only accepts files by names you provide
§Notes
Providing an empty list means you have no names to accept. So all files will be ignored.
SymlinkFiles
§A filter that only accepts symbolic link files
UserDefined
§User defined filter
accept() should return true to accept given path, false to ignore it
§Notes
-
Filters of files should always return
trueif input path is a directory. -
Filters of directories should always return
trueif input path is a file. -
Because of above rules,
accept(...) == falseis not always the opposite meaning that one might expect. For instance:- If
SymlinkFilesignores a file, that means the file is not a symbolic link file. However… - If it accepts that file, it does not mean that the file is a symbolic link file. Obviously, it might be a directory.
- If
Implementations§
Source§impl Filter<'_>
impl Filter<'_>
Sourcepub async fn make_same_device<P>(path: P) -> Result<Self>
Available on crate feature async-std and Unix only.
pub async fn make_same_device<P>(path: P) -> Result<Self>
async-std and Unix only.