use crate::progress::ProgressReporter;
use anyhow::Result;
#[derive(Debug, Clone)]
pub enum ScanStatus {
Pruneable(u64),
Clean,
NotFound,
#[allow(dead_code)]
PermissionDenied,
}
#[derive(Debug, Clone)]
pub struct ScanResult {
pub name: &'static str,
pub status: ScanStatus,
}
#[derive(Debug)]
pub struct CleanResult {
#[allow(dead_code)]
pub name: &'static str,
pub bytes_freed: u64,
}
pub trait Cleaner: Send + Sync {
fn name(&self) -> &'static str;
fn detect(&self) -> ScanResult;
fn clean(&self, dry_run: bool, reporter: &dyn ProgressReporter) -> Result<CleanResult>;
}