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

Method save_delegation

atomic-identity/src/store.rs:779–786  ·  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

777 ///
778 /// `document` is written verbatim — the bytes the proof covers.
779 pub fn save_delegation(&self, id: &str, document: &str) -> Result<(), IdentityError> {
780 let dir = self.delegations_dir();
781 if !dir.exists() {
782 fs::create_dir_all(&dir)?;
783 }
784 fs::write(self.delegation_path(id), document)?;
785 Ok(())
786 }
787
788 /// Load a delegation certificate by base32 id.
789 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