Struct grep_searcher::SinkMatch [−][src]
pub struct SinkMatch<'b> { /* fields omitted */ }
A type that describes a match reported by a searcher.
Methods
impl<'b> SinkMatch<'b>
[src]
impl<'b> SinkMatch<'b>
pub fn bytes(&self) -> &'b [u8]
[src]
pub fn bytes(&self) -> &'b [u8]
Returns the bytes for all matching lines, including the line terminators, if they exist.
ⓘImportant traits for LineIter<'b>pub fn lines(&self) -> LineIter<'b>
[src]
pub fn lines(&self) -> LineIter<'b>
Return an iterator over the lines in this match.
If multi line search is enabled, then this may yield more than one line (but always at least one line). If multi line search is disabled, then this always reports exactly one line (but may consist of just the line terminator).
Lines yielded by this iterator include their terminators.
pub fn absolute_byte_offset(&self) -> u64
[src]
pub fn absolute_byte_offset(&self) -> u64
Returns the absolute byte offset of the start of this match. This offset is absolute in that it is relative to the very beginning of the input in a search, and can never be relied upon to be a valid index into an in-memory slice.
pub fn line_number(&self) -> Option<u64>
[src]
pub fn line_number(&self) -> Option<u64>
Returns the line number of the first line in this match, if available.
Line numbers are only available when the search builder is instructed to compute them.
Trait Implementations
impl<'b> Clone for SinkMatch<'b>
[src]
impl<'b> Clone for SinkMatch<'b>
fn clone(&self) -> SinkMatch<'b>
[src]
fn clone(&self) -> SinkMatch<'b>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'b> Debug for SinkMatch<'b>
[src]
impl<'b> Debug for SinkMatch<'b>