pub struct DirectorySearcher { /* private fields */ }Expand description
The DirectorySearcher struct in Rust provides functionality to search directories for specific
files while maintaining a blacklist of paths.
Properties:
blacklist: Theblacklistproperty in theDirectorySearcherstruct is a HashSet that stores strings representing paths that should be excluded from the search. This blacklist is used to skip certain directories during the search process.blacklist_file_write: Theblacklist_file_writeproperty in theDirectorySearcherstruct is of typeFile. It is used to store a file handle for writing to the blacklist file. This file handle is used to append entries to the blacklist file when needed, such as when a path is added to
Implementations§
Source§impl DirectorySearcher
impl DirectorySearcher
Sourcepub fn new() -> Self
pub fn new() -> Self
The function creates a new instance of DirectorySearcher with a blacklist HashSet and a file for writing blacklist entries.
Returns:
A new instance of the DirectorySearcher struct is being returned.
Sourcepub fn update_blacklist(&mut self)
pub fn update_blacklist(&mut self)
The function update_blacklist reads a file named “blacklist.txt” and updates a blacklist
collection with its contents.
Auto Trait Implementations§
impl Freeze for DirectorySearcher
impl RefUnwindSafe for DirectorySearcher
impl Send for DirectorySearcher
impl Sync for DirectorySearcher
impl Unpin for DirectorySearcher
impl UnwindSafe for DirectorySearcher
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