pub struct Report { /* private fields */ }
Expand description
A Report is notified of problems or non-problematic events that occur while Conserve is running.
A Report holds counters, identified by a name. The name must be in KNOWN_COUNTERS
.
A Report is internally mutable, so a single instance can be shared by multiple objects or scopes (on the same thread) who all append to it.
Cloning a Report makes a shared reference to the same underlying counters.
Implementations§
source§impl Report
impl Report
pub fn set_print_filenames(&mut self, p: bool)
sourcepub fn borrow_counts(&self) -> MutexGuard<'_, Counts>
pub fn borrow_counts(&self) -> MutexGuard<'_, Counts>
Borrow (read-only) counters inside this report.
sourcepub fn increment(&self, counter_name: &'static str, delta: u64)
pub fn increment(&self, counter_name: &'static str, delta: u64)
Increment a counter by a given amount.
The name must be a static string. Counters implicitly start at 0.
pub fn increment_size(&self, counter_name: &str, sizes: Sizes)
sourcepub fn merge_from(&self, from_report: &Report)
pub fn merge_from(&self, from_report: &Report)
Merge the contents of from_report
into self
.
pub fn get_size(&self, counter_name: &str) -> Sizes
pub fn get_count(&self, counter_name: &str) -> u64
sourcepub fn start_entry(&self, entry: &dyn Entry)
pub fn start_entry(&self, entry: &dyn Entry)
Report that processing started for a given entry.
pub fn clear_phase(&self)
pub fn print(&self, s: &str)
sourcepub fn problem(&self, s: &str)
pub fn problem(&self, s: &str)
Report that a problem occurred.
Later this might also count or summarize them.
pub fn finish(&self)
sourcepub fn set_total_work(&self, w: u64)
pub fn set_total_work(&self, w: u64)
Set the total expected work (in bytes); this also resets the amount of work done.
pub fn increment_work(&self, w: u64)
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Report
impl Send for Report
impl Sync for Report
impl Unpin for Report
impl UnwindSafe for Report
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> Separable for Twhere
T: Display,
impl<T> Separable for Twhere
T: Display,
source§fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
SeparatorPolicy
. Read more