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

Method save_change

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

Save a change to the repository. The change is serialized and written to the `.atomic/changes/` directory using a content-addressed two-level directory structure. The change is also cached for efficient subsequent access. # Arguments `change` - The change to save # Returns The hash of the saved change, which can be used to retrieve it later. # Errors Returns an error if: - The directory can

(&self, change: &Change)

Source from the content-addressed store, hash-verified

85 /// println!("Saved change: {}", hash.to_base32());
86 /// ```
87 pub fn save_change(&self, change: &Change) -> Result<Hash, RepositoryError> {
88 self.change_store
89 .save_change(change)
90 .map_err(|e| RepositoryError::Database(e.to_string()))
91 }
92
93 /// Save a change using pre-serialized V3 bytes (hash-stable).
94 ///

Calls

no outgoing calls