[][src]Struct grep_searcher::SinkContext

pub struct SinkContext<'b> { /* fields omitted */ }

A type that describes a contextual line reported by a searcher.

Methods

impl<'b> SinkContext<'b>[src]

pub fn bytes(&self) -> &'b [u8][src]

Returns the context bytes, including line terminators.

pub fn kind(&self) -> &SinkContextKind[src]

Returns the type of context.

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

Returns the absolute byte offset of the start of this context. 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 context, if available.

Line numbers are only available when the search builder is instructed to compute them.

Trait Implementations

impl<'b> Clone for SinkContext<'b>[src]

impl<'b> Debug for SinkContext<'b>[src]

Auto Trait Implementations

impl<'b> RefUnwindSafe for SinkContext<'b>

impl<'b> Send for SinkContext<'b>

impl<'b> Sync for SinkContext<'b>

impl<'b> Unpin for SinkContext<'b>

impl<'b> UnwindSafe for SinkContext<'b>

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.