| 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 ───────────────────────────────────────────────────────── |