pub struct SinkMatch<'b> { /* private fields */ }Expand description
A type that describes a match reported by a searcher.
Implementations§
Source§impl<'b> SinkMatch<'b>
impl<'b> SinkMatch<'b>
Sourcepub fn bytes(&self) -> &'b [u8] ⓘ
pub fn bytes(&self) -> &'b [u8] ⓘ
Returns the bytes for all matching lines, including the line terminators, if they exist.
Sourcepub fn absolute_byte_offset(&self) -> u64
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.
Sourcepub fn line_number(&self) -> Option<u64>
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.
Sourcepub fn buffer(&self) -> &'b [u8] ⓘ
pub fn buffer(&self) -> &'b [u8] ⓘ
Exposes as much of the underlying buffer that was searched as possible.
Sourcepub fn bytes_range_in_buffer(&self) -> Range<usize>
pub fn bytes_range_in_buffer(&self) -> Range<usize>
Returns a range that corresponds to where SinkMatch::bytes appears
in SinkMatch::buffer.
Trait Implementations§
Auto Trait Implementations§
impl<'b> Freeze for SinkMatch<'b>
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> UnsafeUnpin for SinkMatch<'b>
impl<'b> UnwindSafe for SinkMatch<'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