pub struct Match {
pub path: PathBuf,
pub line: Option<u64>,
pub column: Option<usize>,
pub bytes: Vec<u8>,
pub submatches: Vec<SubMatch>,
pub line_text: String,
pub context: Vec<ContextLine>,
}Expand description
A structured match result.
use ripgrep_api::SearchBuilder;
let mut matches = SearchBuilder::new("alpha")
.path(".")
.max_count(1)
.build()?
.collect::<Vec<_>>();
let first = matches.pop().unwrap();
println!("{}:{}", first.path.display(), first.line.unwrap_or(0));Fields§
§path: PathBuf§line: Option<u64>§column: Option<usize>§bytes: Vec<u8>§submatches: Vec<SubMatch>§line_text: String§context: Vec<ContextLine>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