MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / load_change

Method load_change

atomic-repository/src/repository/changes.rs:145–150  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 ///

Callers 15

materialize_parallelMethod · 0.45
switch_viewMethod · 0.45
kg_enrich_changesMethod · 0.45
kg_enrich_changeMethod · 0.45
logMethod · 0.45
reverse_logMethod · 0.45
unrecordMethod · 0.45
insert_changeMethod · 0.45
insert_change_recMethod · 0.45
classify_hashesMethod · 0.45

Calls

no outgoing calls