use std::path::PathBuf;
use tokio::sync::mpsc;
#[derive(Debug, Clone)]
#[non_exhaustive]
pub enum AnalysisProgress {
EntryAnalyzed { path: PathBuf },
#[cfg(feature = "checksum")]
EntryHashed { path: PathBuf },
}
#[derive(Clone)]
pub(crate) struct AnalysisProgressReporter {
tx: mpsc::UnboundedSender<AnalysisProgress>,
}
impl AnalysisProgressReporter {
pub(crate) fn new(tx: mpsc::UnboundedSender<AnalysisProgress>) -> Self {
Self { tx }
}
pub(crate) fn send(&self, progress: AnalysisProgress) {
let _ = self.tx.send(progress);
}
}