MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / get_session_record

Method get_session_record

atomic-core/src/pristine/txn/read.rs:1041–1056  ·  view source on GitHub ↗

Read the indexed metadata for an external session ID.

(
        &self,
        session_id: &str,
    )

Source from the content-addressed store, hash-verified

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.

Calls 2

valueMethod · 0.80
getMethod · 0.65