Walk

Struct Walk 

Source
pub struct Walk {
    pub path: PathBuf,
    /* private fields */
}
Expand description

The ‘Walk’ struct contains all the information we need to traverse a directory.

Fields§

§path: PathBuf

Implementations§

Source§

impl Walk

Source

pub fn print_dir(w: &Walk, total: &Arc<AtomicUsize>)

function to make output from a ‘Walk’, using one thread. It also takes an ‘Arc’ and will add the relevant directory sizes to it.

Source

pub fn set_depth(&mut self, d: u8)

set the maximum depth to display

Source

pub fn set_regex(&mut self, r: Regex)

set the regex for excludes

Source

pub fn set_threshold(&mut self, n: u64)

set the minumum file size

Source

pub fn with_files(&mut self)

include files when printing

Source

pub fn blocks(&mut self)

include files when printing

Source

pub fn artifacts_only(&mut self)

include files when printing

Source

pub fn new(p: PathBuf, n: usize) -> Walk

Create a new ‘Walk’ from a ‘PathBuf’ and the number of processor cores to be used.

Source

pub fn push_subdir( w: &Walk, worker: &mut Worker<Status<Walk>>, total: &Arc<AtomicUsize>, )

This takes a ‘Walk’ and a ‘Worker<Status>’ and executes the walk in parallel, creating new work for each subdirectory. It’s not the most efficient concurrency imaginable, but it’s fast and easy-ish to use. It also takes in an ‘Arc’, which it updates with any file sizes in the directory.

Trait Implementations§

Source§

impl Debug for Walk

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Walk

§

impl RefUnwindSafe for Walk

§

impl Send for Walk

§

impl Sync for Walk

§

impl Unpin for Walk

§

impl UnwindSafe for Walk

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.
Source§

impl<T> Erased for T