[−][src]Struct grep_printer::SummarySink
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
impl<'p, 's, M: Matcher, W: WriteColor> SummarySink<'p, 's, M, W>[src]
pub fn has_match(&self) -> bool[src]
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.
pub fn binary_byte_offset(&self) -> Option<u64>[src]
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.
pub fn stats(&self) -> Option<&Stats>[src]
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
impl<'p, 's, M: Debug + Matcher, W: Debug + 's> Debug for SummarySink<'p, 's, M, W>[src]
impl<'p, 's, M: Matcher, W: WriteColor> Sink for SummarySink<'p, 's, M, W>[src]
type Error = Error
The type of an error that should be reported by a searcher. Read more
fn matched(
&mut self,
_searcher: &Searcher,
mat: &SinkMatch
) -> Result<bool, Error>[src]
&mut self,
_searcher: &Searcher,
mat: &SinkMatch
) -> Result<bool, Error>
fn begin(&mut self, _searcher: &Searcher) -> Result<bool, Error>[src]
fn finish(
&mut self,
searcher: &Searcher,
finish: &SinkFinish
) -> Result<(), Error>[src]
&mut self,
searcher: &Searcher,
finish: &SinkFinish
) -> Result<(), Error>
fn context(
&mut self,
_searcher: &Searcher,
_context: &SinkContext
) -> Result<bool, Self::Error>[src]
&mut self,
_searcher: &Searcher,
_context: &SinkContext
) -> Result<bool, Self::Error>
fn context_break(&mut self, _searcher: &Searcher) -> Result<bool, Self::Error>[src]
fn binary_data(
&mut self,
_searcher: &Searcher,
_binary_byte_offset: u64
) -> Result<bool, Self::Error>[src]
&mut self,
_searcher: &Searcher,
_binary_byte_offset: u64
) -> Result<bool, Self::Error>
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,
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,
M: Unpin,
impl<'p, 's, M, W> !UnwindSafe for SummarySink<'p, 's, M, W>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,