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)
| 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 | /// |