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

Method list_session_records

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

565 /// Read every indexed session record. Ordering is left to callers because
566 /// recency depends on turn timestamps, not the session-id table key.
567 pub fn list_session_records(
568 &self,
569 ) -> PristineResult<Vec<crate::change::session::SessionRecord>> {
570 use crate::change::session::SessionRecord;
571
572 let table = self.txn.open_table(SESSIONS)?;
573 let mut records = Vec::new();
574 for result in table.iter()? {
575 let (_key, value) = result?;
576 let record = SessionRecord::from_bytes(value.value()).map_err(|e| {
577 PristineError::Serialization {
578 message: format!("session record decode: {}", e),
579 }
580 })?;
581 records.push(record);
582 }
583 Ok(records)
584 }
585
586 /// Read all indexed turns for an external session ID in turn order.
587 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