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,
)
| 1296 | /// Unlike `find_provenance_for_session`, this reads only the session index |
| 1297 | /// and turn records; it does not scan unrelated provenance files. |
| 1298 | pub fn get_session_ledger( |
| 1299 | &self, |
| 1300 | session_id: &str, |
| 1301 | ) -> Result< |
| 1302 | Option<( |
| 1303 | atomic_core::change::session::SessionRecord, |
| 1304 | Vec<atomic_core::change::session::SessionTurn>, |
| 1305 | )>, |
| 1306 | RepositoryError, |
| 1307 | > { |
| 1308 | let txn = self |
| 1309 | .pristine |
| 1310 | .read_txn() |
| 1311 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 1312 | let record = txn |
| 1313 | .get_session_record(session_id) |
| 1314 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 1315 | match record { |
| 1316 | Some(record) => { |
| 1317 | let turns = txn |
| 1318 | .get_session_turns(session_id) |
| 1319 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 1320 | Ok(Some((record, turns))) |
| 1321 | } |
| 1322 | None => Ok(None), |
| 1323 | } |
| 1324 | } |
| 1325 | |
| 1326 | /// List recent session ledgers, newest activity first. |
| 1327 | /// |