Store an immutable session manifest and advance its convenience head.
(
&mut self,
manifest: &crate::change::session::SessionManifest,
)
| 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. |