Struct grep_printer::SummarySink [−][src]
pub struct SummarySink<'p, 's, M: Matcher, W> { /* fields omitted */ }
Expand description
An implementation of Sink associated with a matcher and an optional file
path for the summary printer.
This type is generic over a few type parameters:
'prefers to the lifetime of the file path, if one is provided. When no file path is given, then this is'static.'srefers to the lifetime of theSummaryprinter that this type borrows.Mrefers to the type of matcher used bygrep_searcher::Searcherthat is reporting results to this sink.Wrefers to the underlying writer that this printer is writing its output to.
Implementations
Returns true if and only if this printer received a match in the previous search.
This is unaffected by the result of searches before the previous search.
If binary data was found in the previous search, this returns the offset at which the binary data was first detected.
The offset returned is an absolute offset relative to the entire set of bytes searched.
This is unaffected by the result of searches before the previous
search. e.g., If the search prior to the previous search found binary
data but the previous search found no binary data, then this will
return None.
Return a reference to the stats produced by the printer for all searches executed on this sink.
This only returns stats if they were requested via the
SummaryBuilder
configuration.
Trait Implementations
This method is called whenever a match is found. Read more
This method is called when a search has begun, before any search is executed. By default, this does nothing. Read more
This method is called when a search has completed. By default, this does nothing. Read more
This method is called whenever a context line is found, and is optional
to implement. By default, it does nothing and returns true. Read more
This method is called whenever a break in contextual lines is found,
and is optional to implement. By default, it does nothing and returns
true. Read more
This method is called whenever binary detection is enabled and binary data is found. If binary data is found, then this is called at least once for the first occurrence with the absolute byte offset at which the binary data begins. Read more
Auto Trait Implementations
impl<'p, 's, M, W> !RefUnwindSafe for SummarySink<'p, 's, M, W>impl<'p, 's, M, W> Send for SummarySink<'p, 's, M, W> where
M: Send,
W: Send, impl<'p, 's, M, W> !Sync for SummarySink<'p, 's, M, W>impl<'p, 's, M, W> Unpin for SummarySink<'p, 's, M, W> where
M: Unpin, impl<'p, 's, M, W> !UnwindSafe for SummarySink<'p, 's, M, W>