[][src]Struct grep_printer::Stats

pub struct Stats { /* fields omitted */ }

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

impl Stats[src]

pub fn new() -> Stats[src]

Return a new value for tracking aggregate statistics across searches.

All statistics are set to 0.

pub fn elapsed(&self) -> Duration[src]

Return the total amount of time elapsed.

pub fn searches(&self) -> u64[src]

Return the total number of searches executed.

pub fn searches_with_match(&self) -> u64[src]

Return the total number of searches that found at least one match.

pub fn bytes_searched(&self) -> u64[src]

Return the total number of bytes searched.

pub fn bytes_printed(&self) -> u64[src]

Return the total number of bytes printed.

pub fn matched_lines(&self) -> u64[src]

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.

pub fn matches(&self) -> u64[src]

Return the total number of matches.

There may be multiple matches per line.

pub fn add_elapsed(&mut self, duration: Duration)[src]

Add to the elapsed time.

pub fn add_searches(&mut self, n: u64)[src]

Add to the number of searches executed.

pub fn add_searches_with_match(&mut self, n: u64)[src]

Add to the number of searches that found at least one match.

pub fn add_bytes_searched(&mut self, n: u64)[src]

Add to the total number of bytes searched.

pub fn add_bytes_printed(&mut self, n: u64)[src]

Add to the total number of bytes printed.

pub fn add_matched_lines(&mut self, n: u64)[src]

Add to the total number of lines that participated in a match.

pub fn add_matches(&mut self, n: u64)[src]

Add to the total number of matches.

Trait Implementations

impl<'a> Add<&'a Stats> for Stats[src]

type Output = Stats

The resulting type after applying the + operator.

impl Add<Stats> for Stats[src]

type Output = Stats

The resulting type after applying the + operator.

impl<'a> AddAssign<&'a Stats> for Stats[src]

impl AddAssign<Stats> for Stats[src]

impl Clone for Stats[src]

impl Debug for Stats[src]

impl Default for Stats[src]

impl Eq for Stats[src]

impl PartialEq<Stats> for Stats[src]

impl Serialize for Stats[src]

impl StructuralEq for Stats[src]

impl StructuralPartialEq for Stats[src]

Auto Trait Implementations

impl RefUnwindSafe for Stats

impl Send for Stats

impl Sync for Stats

impl Unpin for Stats

impl UnwindSafe for Stats

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.