MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / load

Method load

nodedb/src/control/array_sync/outbound/subscriber_state.rs:236–242  ·  view source on GitHub ↗

Load a subscriber cursor, returning `None` if not found.

(&self, session_id: &str, array_name: &str)

Source from the content-addressed store, hash-verified

234
235 /// Load a subscriber cursor, returning `None` if not found.
236 fn load(&self, session_id: &str, array_name: &str) -> Option<ArraySubscriberState> {
237 let key = Self::cursor_key(session_id, array_name);
238 let txn = self.db.begin_read().ok()?;
239 let table = txn.open_table(CURSOR_TABLE).ok()?;
240 let entry = table.get(key.as_str()).ok()??;
241 zerompk::from_msgpack(entry.value()).ok()
242 }
243
244 /// Delete all cursors for a given session (disconnect cleanup).
245 fn delete_session(&self, session_id: &str) {

Callers 1

registerMethod · 0.45

Calls 3

okMethod · 0.45
getMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected