pub struct SearchConfig { /* private fields */ }Expand description
This struct holds the configuration for searching directories.
It includes options for regex matching, hiding hidden files, keeping directories, matching file extensions, whether to search file names only, depth of search, and whether to follow symlinks.
Implementations§
Source§impl SearchConfig
impl SearchConfig
Sourcepub fn matches_with<F: FnOnce(&[u8]) -> bool>(
&self,
path: &[u8],
predicate: F,
) -> bool
pub fn matches_with<F: FnOnce(&[u8]) -> bool>( &self, path: &[u8], predicate: F, ) -> bool
Evaluates a custom predicate function against a path
Sourcepub fn matches_extension<S>(&self, entry: &S) -> bool
pub fn matches_extension<S>(&self, entry: &S) -> bool
Applies the size filter to a directory entry if configured Works differently for regular files vs symlinks (resolves symlinks first)
Sourcepub fn matches_size<S>(&self, entry: &DirEntry<S>) -> boolwhere
S: BytesStorage,
pub fn matches_size<S>(&self, entry: &DirEntry<S>) -> boolwhere
S: BytesStorage,
Applies the size filter to a directory entry if configured. Works differently for regular files vs symlinks (resolves symlinks first).
Sourcepub fn matches_type<S>(&self, entry: &DirEntry<S>) -> boolwhere
S: BytesStorage,
pub fn matches_type<S>(&self, entry: &DirEntry<S>) -> boolwhere
S: BytesStorage,
Applies a type filter (single-character code for file type) Supports common file types: file, dir, symlink, device, pipe, etc
Sourcepub fn matches_path<S>(&self, dir: &DirEntry<S>, full_path: bool) -> boolwhere
S: BytesStorage,
pub fn matches_path<S>(&self, dir: &DirEntry<S>, full_path: bool) -> boolwhere
S: BytesStorage,
Checks if the path or file name matches the regex filter
If full_path is false, only checks the filename
Trait Implementations§
Source§impl Clone for SearchConfig
impl Clone for SearchConfig
Source§fn clone(&self) -> SearchConfig
fn clone(&self) -> SearchConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SearchConfig
impl RefUnwindSafe for SearchConfig
impl Send for SearchConfig
impl Sync for SearchConfig
impl Unpin for SearchConfig
impl UnwindSafe for SearchConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneUnsized for Twhere
T: Clone,
impl<T> CloneUnsized for Twhere
T: Clone,
Source§fn unsized_clone_from(&mut self, source: &T)
fn unsized_clone_from(&mut self, source: &T)
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>
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>
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