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

Method list_session_records

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

610 /// Read every indexed session record. Ordering is left to callers because
611 /// recency depends on turn timestamps, not the session-id table key.
612 pub fn list_session_records(
613 &self,
614 ) -> PristineResult<Vec<crate::change::session::SessionRecord>> {
615 use crate::change::session::SessionRecord;
616
617 let table = self.txn.open_table(SESSIONS)?;
618 let mut records = Vec::new();
619 for result in table.iter()? {
620 let (_key, value) = result?;
621 let record = SessionRecord::from_bytes(value.value()).map_err(|e| {
622 PristineError::Serialization {
623 message: format!("session record decode: {}", e),
624 }
625 })?;
626 records.push(record);
627 }
628 Ok(records)
629 }
630
631 /// Read all indexed turns for an external session ID in turn order.
632 pub fn get_session_turns(

Callers 2

rebuild_session_indexMethod · 0.80
list_session_ledgersMethod · 0.80

Calls 2

iterMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected