Skip to main content

RestoreOutcome

Struct RestoreOutcome 

Source
pub struct RestoreOutcome {
    pub label: String,
    pub adapter: String,
    pub bytes: u64,
    pub elapsed: Duration,
    pub result: Result<()>,
}
Expand description

Restore exactly the projects a previous pass emptied, and nothing else.

deleted is the (bloat directory label, adapter name) pairs recorded at prune time. restore_project_to_depth would reinstall every project in the tree; a repository where one of five projects was pruned does not want the other four rebuilt, which on a monorepo is the difference between one npm ci and five.

A recorded pair that no longer matches anything in the tree — the project was deleted, renamed, or its manifest removed since the prune — comes back as an Err under its own label rather than being dropped, because a restore that silently skips half its work is the failure mode this whole command exists to avoid. One recorded directory’s restore: what was attempted, whether it worked, and what it cost.

The cost is carried out of the engine rather than measured by the caller because this is the only place that knows where one directory’s rebuild starts and ends. A caller timing the whole pass would learn the average of a node_modules and a target, which is a number about nothing.

Fields§

§label: String

adapter (repo/relative/dir), as the command prints it.

§adapter: String

The adapter that owned the directory.

§bytes: u64

Bytes the prune recorded for it — what this restore is putting back.

§elapsed: Duration

How long the rebuild took, successful or not.

§result: Result<()>

Whether it worked.

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

Source§

type Output = T

Should always be Self
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.