pub struct Match {
pub file_path: PathBuf,
pub line_number: u32,
pub col: u32,
pub line_content: String,
pub byte_offset: u64,
pub context_before: Vec<String>,
pub context_after: Vec<String>,
pub is_binary: bool,
}Expand description
A single regex match found in a file.
Fields§
§file_path: PathBufAbsolute path to the file containing the match.
line_number: u321-based line number.
col: u321-based column within the line (byte offset).
line_content: StringThe entire content of the matching line.
byte_offset: u64Byte offset from the start of the file.
context_before: Vec<String>Lines preceding the match (context).
context_after: Vec<String>Lines following the match (context).
is_binary: boolWhether the file was detected as binary.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Match
impl RefUnwindSafe for Match
impl Send for Match
impl Sync for Match
impl Unpin for Match
impl UnsafeUnpin for Match
impl UnwindSafe for Match
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> 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