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

Method save_delegation

atomic-identity/src/store.rs:845–852  ·  view source on GitHub ↗

Store a signed delegation certificate under its id. `document` is written verbatim — the bytes the proof covers.

(&self, id: &str, document: &str)

Source from the content-addressed store, hash-verified

843 ///
844 /// `document` is written verbatim — the bytes the proof covers.
845 pub fn save_delegation(&self, id: &str, document: &str) -> Result<(), IdentityError> {
846 let dir = self.delegations_dir();
847 if !dir.exists() {
848 fs::create_dir_all(&dir)?;
849 }
850 fs::write(self.delegation_path(id), document)?;
851 Ok(())
852 }
853
854 /// Load a delegation certificate by base32 id.
855 pub fn load_delegation(&self, id: &str) -> Result<String, IdentityError> {

Calls 4

delegations_dirMethod · 0.80
delegation_pathMethod · 0.80
writeFunction · 0.50
existsMethod · 0.45