pub struct MatchLocation {
pub line: u64,
pub byte_offset: u64,
pub pattern: String,
}Expand description
The file-level position of a single scanner match.
Emitted via the on_match callback in
StreamScanner::scan_reader_with_callbacks. Line numbers are
1-based and count \n bytes only (Unix line endings). For files with
Windows line endings (\r\n), line is still correct because \n is
the canonical line separator — \r bytes do not affect the count.
byte_offset is the absolute byte position of the first byte of the
matched region within the file (0-based). Both fields refer to the
input file, not the sanitized output.
Fields§
§line: u641-based line number of the match within the file.
byte_offset: u640-based byte offset of the match start within the file.
pattern: StringPattern label that triggered this match.
Trait Implementations§
Source§impl Clone for MatchLocation
impl Clone for MatchLocation
Source§fn clone(&self) -> MatchLocation
fn clone(&self) -> MatchLocation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MatchLocation
impl Debug for MatchLocation
Auto Trait Implementations§
impl Freeze for MatchLocation
impl RefUnwindSafe for MatchLocation
impl Send for MatchLocation
impl Sync for MatchLocation
impl Unpin for MatchLocation
impl UnsafeUnpin for MatchLocation
impl UnwindSafe for MatchLocation
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more