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

Method get_session_record

atomic-core/src/pristine/txn/read.rs:593–608  ·  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

591impl 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.

Callers 2

rebuild_session_indexMethod · 0.80
get_session_ledgerMethod · 0.80

Calls 1

getMethod · 0.65

Tested by

no test coverage detected