pub struct FinderBuilder<S>where
S: BytesStorage,{ /* private fields */ }Expand description
A builder for creating a Finder instance with customisable options.
This builder allows you to set various options such as hiding hidden files, case sensitivity, keeping directories in results, matching file extensions, setting maximum search depth, following symlinks, and applying a custom filter function.
Implementations§
Source§impl<S> FinderBuilder<S>
impl<S> FinderBuilder<S>
Sourcepub fn new<A: AsRef<OsStr>, B: AsRef<str>>(root: A, pattern: B) -> Self
pub fn new<A: AsRef<OsStr>, B: AsRef<str>>(root: A, pattern: B) -> Self
Create a new FinderBuilder with required fields
Set whether to hide hidden files, defaults to true
Sourcepub const fn case_insensitive(self, case_insensitive: bool) -> Self
pub const fn case_insensitive(self, case_insensitive: bool) -> Self
Set case insensitive matching,defaults to true
Sourcepub const fn keep_dirs(self, keep_dirs: bool) -> Self
pub const fn keep_dirs(self, keep_dirs: bool) -> Self
Set whether to keep directories in results,defaults to false
Sourcepub const fn file_name_only(self, short_path: bool) -> Self
pub const fn file_name_only(self, short_path: bool) -> Self
Set whether to use short pathss in regex matching, defaults to true
Sourcepub fn extension_match<C: AsRef<str>>(self, extension_match: Option<C>) -> Self
pub fn extension_match<C: AsRef<str>>(self, extension_match: Option<C>) -> Self
Set extension to match
Sourcepub const fn filter_by_size(self, size_of: Option<SizeFilter>) -> Self
pub const fn filter_by_size(self, size_of: Option<SizeFilter>) -> Self
Set maximum search depth
Sourcepub const fn follow_symlinks(self, follow_symlinks: bool) -> Self
pub const fn follow_symlinks(self, follow_symlinks: bool) -> Self
Set whether to follow symlinks, defaults to false. Careful for recursion!
Sourcepub const fn filter(self, filter: Option<DirEntryFilter<S>>) -> Self
pub const fn filter(self, filter: Option<DirEntryFilter<S>>) -> Self
Set a custom filter
pub const fn type_filter(self, filter: Option<u8>) -> Self
Auto Trait Implementations§
impl<S> Freeze for FinderBuilder<S>
impl<S> RefUnwindSafe for FinderBuilder<S>
impl<S> Send for FinderBuilder<S>
impl<S> Sync for FinderBuilder<S>
impl<S> Unpin for FinderBuilder<S>
impl<S> UnwindSafe for FinderBuilder<S>
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> 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