pub struct Match {
pub file: PathBuf,
pub line: usize,
pub content: String,
pub context_before: Vec<String>,
pub context_after: Vec<String>,
}Expand description
Represents a single match from a text search.
§Rust Book Reference
Chapter 5.1: Defining and Instantiating Structs https://doc.rust-lang.org/book/ch05-01-defining-structs.html
This is a simple data-carrying struct with public fields.
Fields§
§file: PathBufFile path where the match was found
line: usizeLine number (1-indexed)
content: StringContent of the matching line
context_before: Vec<String>Context lines before the match
context_after: Vec<String>Context lines after the match
Trait Implementations§
impl Eq for Match
impl StructuralPartialEq for Match
Auto Trait Implementations§
impl Freeze for Match
impl RefUnwindSafe for Match
impl Send for Match
impl Sync for Match
impl Unpin 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