Read the Atomic-native indexed ledger for a session. Unlike `find_provenance_for_session`, this reads only the session index and turn records; it does not scan unrelated provenance files.
(
&self,
session_id: &str,
)
| 1676 | /// Unlike `find_provenance_for_session`, this reads only the session index |
| 1677 | /// and turn records; it does not scan unrelated provenance files. |
| 1678 | pub fn get_session_ledger( |
| 1679 | &self, |
| 1680 | session_id: &str, |
| 1681 | ) -> Result< |
| 1682 | Option<( |
| 1683 | atomic_core::change::session::SessionRecord, |
| 1684 | Vec<atomic_core::change::session::SessionTurn>, |
| 1685 | )>, |
| 1686 | RepositoryError, |
| 1687 | > { |
| 1688 | let txn = self |
| 1689 | .pristine |
| 1690 | .read_txn() |
| 1691 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 1692 | let record = txn |
| 1693 | .get_session_record(session_id) |
| 1694 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 1695 | match record { |
| 1696 | Some(record) => { |
| 1697 | let turns = txn |
| 1698 | .get_session_turns(session_id) |
| 1699 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 1700 | Ok(Some((record, turns))) |
| 1701 | } |
| 1702 | None => Ok(None), |
| 1703 | } |
| 1704 | } |
| 1705 | |
| 1706 | /// List recent session ledgers, newest activity first. |
| 1707 | /// |