pub enum Step {
Freeing(Freeing),
Finished(Removed),
Swept(PathBuf),
}Expand description
What a removal reports while it is happening.
Three events rather than one, for the same reason crate::Found has three: the bytes
leave the disk over seconds, the target is removed once, and the pool moves off it once.
A live view needs all three — a row cannot show its size falling toward zero if the only
news it ever gets is that the directory has already gone.
Finished and Swept are different questions and that
is why both exist. “What happened to this directory” is answered only for a target
something happened to, because a row dropped for a target the final report then lists as
untouched is the view and the report disagreeing. “Where has the deleter got to” is
answered for every target, because a batch that fails on all of them has still been worked
through — and a position indicator that reads zero throughout is describing the outcome
rather than the position.
§Every path here is the one the caller asked about
Not the resolved path the unlinkat was issued against — PlanTarget::requested, the
spelling that went in. The two differ whenever the target is reached through a symlinked
ancestor or named relatively, which on a real run is the common case and not the exotic
one: a bare pristine scans ., so every claim it finds is spelled ./… and every one
of them resolves to something else.
It is stated here because a caller cannot work around getting it wrong. A live view keys its rows on the paths it handed in, and a report in the other spelling matches none of them — silently, since a path that finds no row is indistinguishable from a row that was never drawn. What that looks like is a removal of 150 GiB during which nothing on screen moves except the one counter that needs no path.
Variants§
Freeing(Freeing)
Bytes have left the disk and this target is still being swept.
Finished(Removed)
The sweep removed something from this target, in whole or in part.
Emitted only when Removal::removed will carry this target too, which is the
condition a row disappearing is allowed to rest on.
Swept(PathBuf)
The pool has moved off this target, whatever it managed — including nothing.
One per target in the plan, always, and always after any Finished
for the same path. It is deliberately not a claim that anything was deleted: a target
that failed before unlinking a single entry, or that had already vanished, is one the
deleter is no longer working on, and that is the whole of what this says.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Step
impl RefUnwindSafe for Step
impl Send for Step
impl Sync for Step
impl Unpin for Step
impl UnsafeUnpin for Step
impl UnwindSafe for Step
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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