[−][src]Struct grep_searcher::SinkMatch
A type that describes a match reported by a searcher.
Methods
impl<'b> SinkMatch<'b>
[src]
pub fn bytes(&self) -> &'b [u8]
[src]
Returns the bytes for all matching lines, including the line terminators, if they exist.
pub fn lines(&self) -> LineIter<'b>
[src]
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]
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]
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
Auto Trait Implementations
impl<'b> RefUnwindSafe for SinkMatch<'b>
impl<'b> Send for SinkMatch<'b>
impl<'b> Sync for SinkMatch<'b>
impl<'b> Unpin for SinkMatch<'b>
impl<'b> UnwindSafe for SinkMatch<'b>
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,