rust_filesearch/models/match_result.rs
1use super::Entry;
2use serde::{Deserialize, Serialize};
3
4/// Represents a content match from grep/search operations
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct ContentMatch {
7 /// The entry containing the match
8 pub entry: Entry,
9 /// Line number where match was found (1-indexed)
10 pub line_number: usize,
11 /// Column where match starts (1-indexed)
12 pub column: usize,
13 /// The matched text/line
14 pub matched_text: String,
15 /// Lines before the match for context
16 #[serde(skip_serializing_if = "Vec::is_empty")]
17 pub context_before: Vec<String>,
18 /// Lines after the match for context
19 #[serde(skip_serializing_if = "Vec::is_empty")]
20 pub context_after: Vec<String>,
21}