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

Method save_session_manifest

atomic-core/src/pristine/txn/write/mod.rs:743–754  ·  view source on GitHub ↗

Store an immutable session manifest and advance its convenience head.

(
        &mut self,
        manifest: &crate::change::session::SessionManifest,
    )

Source from the content-addressed store, hash-verified

741
742 /// Store an immutable session manifest and advance its convenience head.
743 pub fn save_session_manifest(
744 &mut self,
745 manifest: &crate::change::session::SessionManifest,
746 ) -> PristineResult<Hash> {
747 let hash = manifest.content_hash();
748 let mut manifests = self.txn.open_table(SESSION_MANIFESTS)?;
749 let mut heads = self.txn.open_table(SESSION_HEADS)?;
750 let bytes = manifest.to_bytes();
751 manifests.insert(hash.as_bytes(), bytes.as_slice())?;
752 heads.insert(manifest.session_id.as_str(), hash.as_bytes())?;
753 Ok(hash)
754 }
755}
756
757/// Format a Unix epoch milliseconds timestamp to RFC-3339 string.

Calls 6

content_hashMethod · 0.45
to_bytesMethod · 0.45
insertMethod · 0.45
as_bytesMethod · 0.45
as_sliceMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected