Skip to main content

Node

Struct Node 

Source
pub struct Node {
    pub name: OsString,
    pub path: PathBuf,
    pub parent: Option<NodeId>,
    pub reclaimable: u64,
    pub unmeasured: usize,
    pub claims: usize,
    pub modified: Option<SystemTime>,
    pub hit: Option<Hit>,
    pub children: Vec<NodeId>,
    /* private fields */
}
Expand description

One directory on a path to something reclaimable.

Fields§

§name: OsString

The final path component. The root node carries the whole scan root instead.

§path: PathBuf

The full path.

§parent: Option<NodeId>

The directory this one is in, and None for the root.

Carried rather than derived, because everything the front end does to a row is a statement about its ancestry: a mark covers a subtree, so “is this row marked” is a walk upwards, and so is putting a cursor back on the nearest surviving ancestor of a row the deleter has just taken away. Ten steps at this tree’s real depth.

§reclaimable: u64

Measured reclaimable bytes in this subtree, this node included.

§unmeasured: usize

How many claims in this subtree were recorded but not measured, because the scan pruned at them. A node with reclaimable == 0 and unmeasured > 0 is not empty; it is unpriced, and a breakdown is what puts a number on it.

§claims: usize

How many claims are in this subtree, priced or not.

The count a selection is stated in. Bytes alone cannot be, while a default scan prices 8% of what it finds: “41.2 GiB marked” over a tree that is mostly unpriced reads as a small selection, and “120 directories” is the part that is always true.

§modified: Option<SystemTime>

The newest mtime anywhere in this subtree, which is what the age column reports.

The newest rather than the oldest, because the question a row answers is “has anything under here been touched lately” — one file rebuilt this morning is what makes a subtree still in use, and an average or an oldest would hide it behind everything beside it that is stale.

§hit: Option<Hit>

Set when this node is itself a claimed directory, in which case it has no children.

§children: Vec<NodeId>

Children, in insertion order until Tree::sort_by is called.

Trait Implementations§

Source§

impl Debug for Node

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.