Struct grep_printer::Stats
source · pub struct Stats { /* private fields */ }
Expand description
Summary statistics produced at the end of a search.
When statistics are reported by a printer, they correspond to all searches executed with that printer.
Implementations§
source§impl Stats
impl Stats
sourcepub fn new() -> Stats
pub fn new() -> Stats
Return a new value for tracking aggregate statistics across searches.
All statistics are set to 0
.
sourcepub fn searches_with_match(&self) -> u64
pub fn searches_with_match(&self) -> u64
Return the total number of searches that found at least one match.
sourcepub fn bytes_searched(&self) -> u64
pub fn bytes_searched(&self) -> u64
Return the total number of bytes searched.
sourcepub fn bytes_printed(&self) -> u64
pub fn bytes_printed(&self) -> u64
Return the total number of bytes printed.
sourcepub fn matched_lines(&self) -> u64
pub fn matched_lines(&self) -> u64
Return the total number of lines that participated in a match.
When matches may contain multiple lines then this includes every line that is part of every match.
sourcepub fn matches(&self) -> u64
pub fn matches(&self) -> u64
Return the total number of matches.
There may be multiple matches per line.
sourcepub fn add_elapsed(&mut self, duration: Duration)
pub fn add_elapsed(&mut self, duration: Duration)
Add to the elapsed time.
sourcepub fn add_searches(&mut self, n: u64)
pub fn add_searches(&mut self, n: u64)
Add to the number of searches executed.
sourcepub fn add_searches_with_match(&mut self, n: u64)
pub fn add_searches_with_match(&mut self, n: u64)
Add to the number of searches that found at least one match.
sourcepub fn add_bytes_searched(&mut self, n: u64)
pub fn add_bytes_searched(&mut self, n: u64)
Add to the total number of bytes searched.
sourcepub fn add_bytes_printed(&mut self, n: u64)
pub fn add_bytes_printed(&mut self, n: u64)
Add to the total number of bytes printed.
sourcepub fn add_matched_lines(&mut self, n: u64)
pub fn add_matched_lines(&mut self, n: u64)
Add to the total number of lines that participated in a match.
sourcepub fn add_matches(&mut self, n: u64)
pub fn add_matches(&mut self, n: u64)
Add to the total number of matches.
Trait Implementations§
source§impl<'a> AddAssign<&'a Stats> for Stats
impl<'a> AddAssign<&'a Stats> for Stats
source§fn add_assign(&mut self, rhs: &'a Stats)
fn add_assign(&mut self, rhs: &'a Stats)
+=
operation. Read moresource§impl AddAssign<Stats> for Stats
impl AddAssign<Stats> for Stats
source§fn add_assign(&mut self, rhs: Stats)
fn add_assign(&mut self, rhs: Stats)
+=
operation. Read more