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

Method to_array_schema

nodedb/src/control/array_sync/schema_registry.rs:176–183  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

apply_array_schemaFunction · 0.80

Calls 4

lockMethod · 0.80
to_schemaMethod · 0.80
okMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected