1#[derive(Debug, Clone, PartialEq, Eq)]
2pub enum DiffLineKind {
3 Added,
4 Removed,
5 Context,
6 HunkHeader,
7 Meta,
8}
9
10#[derive(Debug, Clone, PartialEq, Eq)]
11pub struct DiffLine {
12 pub kind: DiffLineKind,
13 pub old_line: Option<u32>,
14 pub new_line: Option<u32>,
15 pub raw: String,
16 pub code: String,
17}
18
19#[derive(Debug, Clone, PartialEq, Eq)]
20pub struct DiffHunk {
21 pub old_start: u32,
22 pub old_count: u32,
23 pub new_start: u32,
24 pub new_count: u32,
25 pub header: String,
26 pub lines: Vec<DiffLine>,
27}
28
29#[derive(Debug, Clone, PartialEq, Eq)]
30pub struct DiffFile {
31 pub path: String,
32 pub header_lines: Vec<String>,
33 pub hunks: Vec<DiffHunk>,
34}
35
36#[derive(Debug, Clone, PartialEq, Eq)]
37pub struct DiffDocument {
38 pub files: Vec<DiffFile>,
39}