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: Stringadapter (repo/relative/dir), as the command prints it.
adapter: StringThe adapter that owned the directory.
bytes: u64Bytes the prune recorded for it — what this restore is putting back.
elapsed: DurationHow long the rebuild took, successful or not.
result: Result<()>Whether it worked.
Auto Trait Implementations§
impl Freeze for RestoreOutcome
impl RefUnwindSafe for RestoreOutcome
impl Send for RestoreOutcome
impl Sync for RestoreOutcome
impl Unpin for RestoreOutcome
impl UnsafeUnpin for RestoreOutcome
impl UnwindSafe for RestoreOutcome
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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