Read the indexed metadata for an external session ID.
(
&self,
session_id: &str,
)
| 591 | impl ReadTxn { |
| 592 | /// Read the indexed metadata for an external session ID. |
| 593 | pub fn get_session_record( |
| 594 | &self, |
| 595 | session_id: &str, |
| 596 | ) -> PristineResult<Option<crate::change::session::SessionRecord>> { |
| 597 | use crate::change::session::SessionRecord; |
| 598 | |
| 599 | let table = self.txn.open_table(SESSIONS)?; |
| 600 | match table.get(session_id)? { |
| 601 | Some(value) => SessionRecord::from_bytes(value.value()) |
| 602 | .map(Some) |
| 603 | .map_err(|e| PristineError::Serialization { |
| 604 | message: format!("session record decode: {}", e), |
| 605 | }), |
| 606 | None => Ok(None), |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | /// Read every indexed session record. Ordering is left to callers because |
| 611 | /// recency depends on turn timestamps, not the session-id table key. |
no test coverage detected