Struct DirectorySearcher

Source
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: The blacklist property in the DirectorySearcher struct 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: The blacklist_file_write property in the DirectorySearcher struct is of type File. 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

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.