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

Method to_schema

nodedb-array/src/sync/schema_crdt.rs:89–95  ·  view source on GitHub ↗

Decode the stored schema from the Loro doc. Reads the MessagePack blob at `root["content"]` and decodes it via zerompk. Errors map to [`ArrayError::SegmentCorruption`].

(&self)

Source from the content-addressed store, hash-verified

87 /// Reads the MessagePack blob at `root["content"]` and decodes it via
88 /// zerompk. Errors map to [`ArrayError::SegmentCorruption`].
89 pub fn to_schema(&self) -> ArrayResult<ArraySchema> {
90 let root = self.doc.get_map("root");
91 let bytes = self.read_content_bytes(&root)?;
92 zerompk::from_msgpack(&bytes).map_err(|e| ArrayError::SegmentCorruption {
93 detail: format!("schema decode failed: {e}"),
94 })
95 }
96
97 /// Export the full Loro snapshot as an enveloped byte buffer.
98 ///

Callers 3

tile_extentsMethod · 0.80
to_array_schemaMethod · 0.80

Calls 1

read_content_bytesMethod · 0.80

Tested by 1