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

Method read

nodedb/src/bridge/slab.rs:109–113  ·  view source on GitHub ↗

Read data from a slab page by ID. Returns the payload bytes. The caller must not hold the reference after calling `free()`.

(&self, id: SlabId)

Source from the content-addressed store, hash-verified

107 /// Returns the payload bytes. The caller must not hold the reference
108 /// after calling `free()`.
109 pub fn read(&self, id: SlabId) -> &[u8] {
110 assert_eq!(id.core_id, self.core_id, "slab ID core mismatch");
111 let offset = id.page_index as usize * self.page_size;
112 &self.memory[offset..offset + id.len as usize]
113 }
114
115 /// Free a slab page, returning it to the pool.
116 pub fn free(&mut self, id: SlabId) {

Callers 15

alloc_advances_registryFunction · 0.45
notifyMethod · 0.45
subscription_countMethod · 0.45
list_topicsMethod · 0.45
publishMethod · 0.45
subscribeMethod · 0.45
subscribe_groupMethod · 0.45
unsubscribeMethod · 0.45
topic_statsMethod · 0.45
lookup_arrayMethod · 0.45

Calls

no outgoing calls