Skip to main content

suture_driver/
types.rs

1/// Structured visual diff produced by a driver.
2#[derive(Debug, Clone)]
3pub struct VisualDiff {
4    pub hunks: Vec<DiffHunk>,
5    pub summary: DiffSummary,
6}
7
8/// A single hunk in a visual diff.
9#[derive(Debug, Clone)]
10pub struct DiffHunk {
11    pub path: String,
12    pub old_value: Option<String>,
13    pub new_value: Option<String>,
14    pub hunk_type: DiffHunkType,
15}
16
17/// The type of change in a diff hunk.
18#[derive(Debug, Clone, PartialEq, Eq)]
19pub enum DiffHunkType {
20    Added,
21    Removed,
22    Modified,
23    Moved,
24}
25
26/// Summary statistics for a diff.
27#[derive(Debug, Clone, Default)]
28pub struct DiffSummary {
29    pub additions: usize,
30    pub removals: usize,
31    pub modifications: usize,
32    pub moves: usize,
33}