pub struct Rule {
pub name: Arc<str>,
/* private fields */
}Expand description
A cleanup rule: what identifies a project, and what may be reclaimed from it.
Fields§
§name: Arc<str>Implementations§
Source§impl Rule
impl Rule
Sourcepub fn remove(
name: &str,
markers: &[&str],
targets: &[&str],
) -> Result<Self, RuleError>
pub fn remove( name: &str, markers: &[&str], targets: &[&str], ) -> Result<Self, RuleError>
A rule that reclaims targets from any directory containing all of markers.
Sourcepub fn remove_targets(
name: &str,
markers: &[&str],
targets: Vec<Target>,
) -> Result<Self, RuleError>
pub fn remove_targets( name: &str, markers: &[&str], targets: Vec<Target>, ) -> Result<Self, RuleError>
A rule that reclaims targets, for targets that are not plain directories.
Sourcepub fn remove_self(name: &str, markers: &[&str]) -> Result<Self, RuleError>
pub fn remove_self(name: &str, markers: &[&str]) -> Result<Self, RuleError>
A rule that reclaims the matched directory itself.
Sourcepub fn prune_stale_worktrees(
name: &str,
markers: &[&str],
) -> Result<Self, RuleError>
pub fn prune_stale_worktrees( name: &str, markers: &[&str], ) -> Result<Self, RuleError>
A rule that prunes the records of git worktrees whose checkout is gone.
Sourcepub fn run(
name: &str,
markers: &[&str],
command: &str,
) -> Result<Self, RuleError>
pub fn run( name: &str, markers: &[&str], command: &str, ) -> Result<Self, RuleError>
A rule that runs command in the matched directory.
pub fn action(&self) -> &CleanAction
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
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
Mutably borrows from an owned value. Read more