Read the indexed metadata for an external session ID.
(
&self,
session_id: &str,
)
| 1039 | |
| 1040 | /// Read the indexed metadata for an external session ID. |
| 1041 | pub fn get_session_record( |
| 1042 | &self, |
| 1043 | session_id: &str, |
| 1044 | ) -> PristineResult<Option<crate::change::session::SessionRecord>> { |
| 1045 | use crate::change::session::SessionRecord; |
| 1046 | |
| 1047 | let table = self.txn.open_table(SESSIONS)?; |
| 1048 | match table.get(session_id)? { |
| 1049 | Some(value) => SessionRecord::from_bytes(value.value()) |
| 1050 | .map(Some) |
| 1051 | .map_err(|e| PristineError::Serialization { |
| 1052 | message: format!("session record decode: {}", e), |
| 1053 | }), |
| 1054 | None => Ok(None), |
| 1055 | } |
| 1056 | } |
| 1057 | |
| 1058 | /// Read every indexed session record. Ordering is left to callers because |
| 1059 | /// recency depends on turn timestamps, not the session-id table key. |