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

Method list_session_records

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

Read every indexed session record. Ordering is left to callers because recency depends on turn timestamps, not the session-id table key.

(
        &self,
    )

Source from the content-addressed store, hash-verified

1058 /// Read every indexed session record. Ordering is left to callers because
1059 /// recency depends on turn timestamps, not the session-id table key.
1060 pub fn list_session_records(
1061 &self,
1062 ) -> PristineResult<Vec<crate::change::session::SessionRecord>> {
1063 use crate::change::session::SessionRecord;
1064
1065 let table = self.txn.open_table(SESSIONS)?;
1066 let mut records = Vec::new();
1067 for result in table.iter()? {
1068 let (_key, value) = result?;
1069 let record = SessionRecord::from_bytes(value.value()).map_err(|e| {
1070 PristineError::Serialization {
1071 message: format!("session record decode: {}", e),
1072 }
1073 })?;
1074 records.push(record);
1075 }
1076 Ok(records)
1077 }
1078
1079 /// Read all indexed turns for an external session ID in turn order.
1080 pub fn get_session_turns(

Callers 2

rebuild_session_indexMethod · 0.80
list_session_ledgersMethod · 0.80

Calls 3

valueMethod · 0.80
iterMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected