Struct grep_searcher::SinkContext
source · pub struct SinkContext<'b> { /* private fields */ }
Expand description
A type that describes a contextual line reported by a searcher.
Implementations§
source§impl<'b> SinkContext<'b>
impl<'b> SinkContext<'b>
sourcepub fn kind(&self) -> &SinkContextKind
pub fn kind(&self) -> &SinkContextKind
Returns the type of context.
sourcepub fn absolute_byte_offset(&self) -> u64
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.
sourcepub fn line_number(&self) -> Option<u64>
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§
source§impl<'b> Clone for SinkContext<'b>
impl<'b> Clone for SinkContext<'b>
source§fn clone(&self) -> SinkContext<'b>
fn clone(&self) -> SinkContext<'b>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'b> Freeze for SinkContext<'b>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)