| 76 | /// Errors that can occur during change operations. |
| 77 | #[derive(Debug, Error)] |
| 78 | pub enum ChangeError { |
| 79 | /// IO error during read/write |
| 80 | #[error("IO error: {0}")] |
| 81 | Io(#[from] std::io::Error), |
| 82 | |
| 83 | /// V3 format error (postcard serialization, compression, hash verification, etc.) |
| 84 | #[error("Format error: {0}")] |
| 85 | Format(#[from] format_v3::FormatError), |
| 86 | |
| 87 | /// JSON error for unhashed section |
| 88 | #[error("JSON error: {0}")] |
| 89 | Json(#[from] serde_json::Error), |
| 90 | |
| 91 | /// Hash mismatch during verification |
| 92 | #[error("Change hash mismatch: claimed {claimed}, computed {computed}")] |
| 93 | HashMismatch { claimed: String, computed: String }, |
| 94 | |
| 95 | /// Contents hash mismatch |
| 96 | #[error("Contents hash mismatch: claimed {claimed}, computed {computed}")] |
| 97 | ContentsHashMismatch { claimed: String, computed: String }, |
| 98 | |
| 99 | /// Missing required content |
| 100 | #[error("Missing contents for hash {hash}")] |
| 101 | MissingContents { hash: String }, |
| 102 | |
| 103 | /// Invalid change structure |
| 104 | #[error("Invalid change: {0}")] |
| 105 | Invalid(String), |
| 106 | } |
| 107 | |
| 108 | /// A complete change (patch). |
| 109 | /// |
no outgoing calls
no test coverage detected