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

Method read_content_bytes

nodedb-array/src/sync/schema_crdt.rs:198–208  ·  view source on GitHub ↗
(&self, root: &LoroMap)

Source from the content-addressed store, hash-verified

196 }
197
198 fn read_content_bytes(&self, root: &LoroMap) -> ArrayResult<Vec<u8>> {
199 match root.get("content") {
200 Some(loro::ValueOrContainer::Value(LoroValue::Binary(b))) => Ok(b.to_vec()),
201 Some(other) => Err(ArrayError::SegmentCorruption {
202 detail: format!("expected Binary at root[\"content\"], got {:?}", other),
203 }),
204 None => Err(ArrayError::SegmentCorruption {
205 detail: "root[\"content\"] not found".into(),
206 }),
207 }
208 }
209}
210
211// ─── Envelope helpers ─────────────────────────────────────────────────────────

Callers 1

to_schemaMethod · 0.80

Calls 2

getMethod · 0.45
to_vecMethod · 0.45

Tested by

no test coverage detected