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

Method save_session_manifest

atomic-core/src/pristine/txn/write/mod.rs:742–753  ·  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

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