pub struct Planner { /* private fields */ }Expand description
Builds a Plan under a fixed policy.
Implementations§
Source§impl Planner
impl Planner
Sourcepub fn new(root: impl AsRef<Path>) -> Self
pub fn new(root: impl AsRef<Path>) -> Self
A planner for root, with the safety model’s defaults: one filesystem, no age floor.
Sourcepub fn one_file_system(self, one_file_system: bool) -> Self
pub fn one_file_system(self, one_file_system: bool) -> Self
Whether to refuse a target on a different filesystem from the root. On by default: crossing a mount is how a scan of one project reaches a network share or a backup volume that happens to be mounted inside it.
Sourcepub fn older_than(self, older_than: Option<Duration>) -> Self
pub fn older_than(self, older_than: Option<Duration>) -> Self
Refuse anything touched more recently than this. Off by default — a floor that is on
without being asked for silently keeps directories the user chose — but recommended,
because a node_modules used this morning is not reclaimable in any useful sense.
Sourcepub fn plan<I>(&self, targets: I) -> Planwhere
I: IntoIterator<Item = Target>,
pub fn plan<I>(&self, targets: I) -> Planwhere
I: IntoIterator<Item = Target>,
Resolves and checks every target.
Nothing here touches the filesystem beyond stat and canonicalize. A target that
fails any check is moved to Plan::kept rather than dropped, because a directory
the user selected and did not get is something they need to be told about.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Planner
impl RefUnwindSafe for Planner
impl Send for Planner
impl Sync for Planner
impl Unpin for Planner
impl UnsafeUnpin for Planner
impl UnwindSafe for Planner
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