dove_core/progress.rs
1//! How dove-core reports progress without doing I/O: callers pass a `&dyn Progress`.
2pub trait Progress {
3 fn step(&self, label: &str);
4 fn done(&self, label: &str);
5 fn field(&self, key: &str, value: &str);
6 fn bytes(&self, uploaded: u64, total: u64);
7}
8
9/// A no-op reporter for tests and non-interactive callers.
10pub struct Silent;
11impl Progress for Silent {
12 fn step(&self, _: &str) {}
13 fn done(&self, _: &str) {}
14 fn field(&self, _: &str, _: &str) {}
15 fn bytes(&self, _: u64, _: u64) {}
16}