Load a change from the repository. If the change is in the cache, it's returned directly. Otherwise, it's loaded from disk, verified, and cached. # Arguments `hash` - The hash of the change to load # Errors Returns an error if: - The change doesn't exist (`ChangeNotFound`) - The file is corrupted (hash mismatch) - Deserialization fails # Example ```rust,ignore let change = repo.load_change(
(&self, hash: &Hash)
| 143 | /// println!("Message: {}", change.hashed.header.message); |
| 144 | /// ``` |
| 145 | pub fn load_change(&self, hash: &Hash) -> Result<Change, RepositoryError> { |
| 146 | self.change_store.load_change(hash).map_err(|e| match e { |
| 147 | ChangeStoreError::NotFound { hash } => RepositoryError::ChangeNotFound { hash }, |
| 148 | other => RepositoryError::Database(other.to_string()), |
| 149 | }) |
| 150 | } |
| 151 | |
| 152 | /// Check if a change exists in the repository. |
| 153 | /// |
no outgoing calls