Struct grep_searcher::SinkContext [−][src]
pub struct SinkContext<'b> { /* fields omitted */ }
A type that describes a contextual line reported by a searcher.
Methods
impl<'b> SinkContext<'b>
[src]
impl<'b> SinkContext<'b>
pub fn bytes(&self) -> &'b [u8]
[src]
pub fn bytes(&self) -> &'b [u8]
Returns the context bytes, including line terminators.
pub fn kind(&self) -> &SinkContextKind
[src]
pub fn kind(&self) -> &SinkContextKind
Returns the type of context.
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 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]
pub fn line_number(&self) -> Option<u64>
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> Clone for SinkContext<'b>
fn clone(&self) -> SinkContext<'b>
[src]
fn clone(&self) -> SinkContext<'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)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<'b> Debug for SinkContext<'b>
[src]
impl<'b> Debug for SinkContext<'b>
Auto Trait Implementations
impl<'b> Send for SinkContext<'b>
impl<'b> Send for SinkContext<'b>
impl<'b> Sync for SinkContext<'b>
impl<'b> Sync for SinkContext<'b>