summaryrefslogtreecommitdiffstats
path: root/crates/searcher/src/sink.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/searcher/src/sink.rs')
-rw-r--r--crates/searcher/src/sink.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/searcher/src/sink.rs b/crates/searcher/src/sink.rs
index 750aefbe..f82ffda7 100644
--- a/crates/searcher/src/sink.rs
+++ b/crates/searcher/src/sink.rs
@@ -365,6 +365,8 @@ pub struct SinkMatch<'b> {
pub(crate) bytes: &'b [u8],
pub(crate) absolute_byte_offset: u64,
pub(crate) line_number: Option<u64>,
+ pub(crate) buffer: &'b [u8],
+ pub(crate) bytes_range_in_buffer: std::ops::Range<usize>,
}
impl<'b> SinkMatch<'b> {
@@ -405,6 +407,18 @@ impl<'b> SinkMatch<'b> {
pub fn line_number(&self) -> Option<u64> {
self.line_number
}
+
+ /// TODO
+ #[inline]
+ pub fn buffer(&self) -> &'b [u8] {
+ self.buffer
+ }
+
+ /// TODO
+ #[inline]
+ pub fn bytes_range_in_buffer(&self) -> std::ops::Range<usize> {
+ self.bytes_range_in_buffer.clone()
+ }
}
/// The type of context reported by a searcher.