| 123 | /// per-section zstd compression, and incremental blake3 hashing. |
| 124 | #[derive(Clone, Debug)] |
| 125 | pub struct Change { |
| 126 | /// The hashed portion (contributes to change hash) |
| 127 | pub hashed: HashedChange, |
| 128 | |
| 129 | /// Optional unhashed metadata (JSON) |
| 130 | /// |
| 131 | /// This can contain arbitrary data that doesn't affect the change hash. |
| 132 | /// Useful for storing editor metadata, review comments, AI transcripts, etc. |
| 133 | pub unhashed: Option<serde_json::Value>, |
| 134 | |
| 135 | /// Optional Ed25519 signature over the change's content hash. |
| 136 | /// |
| 137 | /// Excluded from the change hash (the SIGNATURE section is unhashed), so |
| 138 | /// re-signing with a different key never changes the change's identity. |
| 139 | /// `None` for unsigned (legacy) changes. |
| 140 | pub signature: Option<format_v3::ChangeSignature>, |
| 141 | |
| 142 | /// Binary content blob |
| 143 | /// |
| 144 | /// This contains the actual file content referenced by hunks. |
| 145 | /// Hunks reference byte ranges within this blob. |
| 146 | pub contents: Vec<u8>, |
| 147 | } |
| 148 | |
| 149 | impl Change { |
| 150 | /// Create a new change. |
no outgoing calls