1use std::path::PathBuf;
2
3#[derive(Debug, Clone)]
19pub struct Match {
20 pub path: PathBuf,
21 pub line: Option<u64>,
22 pub column: Option<usize>,
23 pub bytes: Vec<u8>,
24 pub submatches: Vec<SubMatch>,
25 pub line_text: String,
26 pub context: Vec<ContextLine>,
27}
28
29#[derive(Debug, Clone)]
30pub struct SubMatch {
31 pub start: usize,
32 pub end: usize,
33}
34
35#[derive(Debug, Clone)]
36pub struct ContextLine {
37 pub path: PathBuf,
38 pub kind: ContextKind,
39 pub line: Option<u64>,
40 pub bytes: Vec<u8>,
41 pub line_text: String,
42}
43
44#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
45pub enum ContextKind {
46 Before,
47 After,
48 Other,
49}