1use serde::Serialize;
6
7#[derive(Debug, Clone, Serialize)]
8pub struct AddRemove {
9 pub name: String,
10 pub signature: String,
11 #[serde(default, skip_serializing_if = "Option::is_none")]
17 pub old_sig_id: Option<String>,
18}
19
20#[derive(Debug, Clone, Serialize)]
21pub struct Renamed {
22 pub from: String,
23 pub to: String,
24 pub signature: String,
25 pub old_sig_id: String,
29}
30
31#[derive(Debug, Clone, Serialize)]
32pub struct Modified {
33 pub name: String,
34 pub signature_before: String,
35 pub signature_after: String,
36 pub signature_changed: bool,
37 pub effect_changes: EffectChanges,
38 pub body_patches: Vec<BodyPatch>,
39 pub old_sig_id: String,
42}
43
44#[derive(Debug, Clone, Serialize, Default)]
45pub struct EffectChanges {
46 pub before: Vec<String>,
47 pub after: Vec<String>,
48 pub added: Vec<String>,
49 pub removed: Vec<String>,
50}
51
52#[derive(Debug, Clone, Serialize)]
53pub struct BodyPatch {
54 pub op: String,
55 pub node_path: String,
56 pub from_kind: String,
57 pub to_kind: String,
58}
59
60#[derive(Debug, Clone, Serialize, Default)]
61pub struct DiffReport {
62 pub added: Vec<AddRemove>,
63 pub removed: Vec<AddRemove>,
64 pub renamed: Vec<Renamed>,
65 pub modified: Vec<Modified>,
66}