Decode and return the `ArraySchema` for `array`, or `None` if unknown or if the schema document cannot be decoded. Used by the distributed applier to build `ArrayCatalogEntry` on every node after applying a committed `ArraySchema` Raft entry.
(
&self,
array: &str,
)
| 174 | /// Used by the distributed applier to build `ArrayCatalogEntry` on every node |
| 175 | /// after applying a committed `ArraySchema` Raft entry. |
| 176 | pub fn to_array_schema( |
| 177 | &self, |
| 178 | array: &str, |
| 179 | ) -> Option<nodedb_array::schema::array_schema::ArraySchema> { |
| 180 | let docs = self.docs.lock().ok()?; |
| 181 | let doc = docs.get(array)?; |
| 182 | doc.to_schema().ok() |
| 183 | } |
| 184 | |
| 185 | /// Export the current Loro snapshot bytes for `array`, or `None` if unknown. |
| 186 | pub fn export_snapshot(&self, array: &str) -> crate::Result<Option<Vec<u8>>> { |
no test coverage detected