Read the indexed metadata for an external session ID.
(
&self,
session_id: &str,
)
| 546 | impl ReadTxn { |
| 547 | /// Read the indexed metadata for an external session ID. |
| 548 | pub fn get_session_record( |
| 549 | &self, |
| 550 | session_id: &str, |
| 551 | ) -> PristineResult<Option<crate::change::session::SessionRecord>> { |
| 552 | use crate::change::session::SessionRecord; |
| 553 | |
| 554 | let table = self.txn.open_table(SESSIONS)?; |
| 555 | match table.get(session_id)? { |
| 556 | Some(value) => SessionRecord::from_bytes(value.value()) |
| 557 | .map(Some) |
| 558 | .map_err(|e| PristineError::Serialization { |
| 559 | message: format!("session record decode: {}", e), |
| 560 | }), |
| 561 | None => Ok(None), |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | /// Read every indexed session record. Ordering is left to callers because |
| 566 | /// recency depends on turn timestamps, not the session-id table key. |
no test coverage detected