Skip to main content

ScanReport

Struct ScanReport 

Source
pub struct ScanReport {
    pub dirs_read: u64,
    pub entries: u64,
    pub files_walked: u64,
    pub bytes_walked: u64,
    pub allocated_walked: u64,
    pub errors: Vec<Error>,
    pub attribution: WalkAttribution,
}
Expand description

What a scan did, including the errors it walked past.

Unreadable directories are skipped rather than aborting the scan — a permission-denied subdirectory should not cost you the other 499,000 files — but they are reported rather than swallowed, so a caller can tell a complete answer from a partial one.

Fields§

§dirs_read: u64

Directories successfully listed.

§entries: u64

Entries observed, directories included.

§files_walked: u64

Regular files whose metadata was observed.

§bytes_walked: u64

Apparent bytes represented by the regular files whose metadata was observed, saturating at u64::MAX.

A measure of the walk’s work, not an answer: a tree whose total no u64 can hold is refused where it is counted (crate::Error::UnrepresentableTotal), and this tally stops at the bound rather than wrapping or panicking before that refusal.

§allocated_walked: u64

Allocated bytes of those files: what the default size metric counts, and what a sparse disk image or a clone makes far smaller than their apparent bytes. It saturates as bytes_walked does.

§errors: Vec<Error>

Paths that could not be read, with the reason.

§attribution: WalkAttribution

Where the walk’s time went, summed across workers.

Implementations§

Source§

impl ScanReport

Source

pub fn is_complete(&self) -> bool

True when every directory in scope was read successfully.

Trait Implementations§

Source§

impl Debug for ScanReport

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ScanReport

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.