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

Function build_schema_snapshot

nodedb-test-support/src/array_sync.rs:51–57  ·  view source on GitHub ↗
(array_name: &str)

Source from the content-addressed store, hash-verified

49/// `(snapshot_bytes, schema_hlc)` suitable for `import_snapshot` calls.
50#[allow(dead_code)]
51pub fn build_schema_snapshot(array_name: &str) -> (Vec<u8>, Hlc) {
52 let hlc_gen = HlcGenerator::new(rep(1));
53 let schema = simple_schema(array_name);
54 let doc = SchemaDoc::from_schema(rep(1), &schema, &hlc_gen).expect("from_schema");
55 let bytes = doc.export_snapshot().expect("export_snapshot");
56 (bytes, doc.schema_hlc())
57}
58
59/// Import a pre-built snapshot on `shared`. Use this with a single
60/// `(bytes, schema_hlc)` tuple shared across all nodes so every replica

Callers 4

register_schema_on_allFunction · 0.85
register_schemaFunction · 0.85

Calls 5

repFunction · 0.85
simple_schemaFunction · 0.70
expectMethod · 0.45
export_snapshotMethod · 0.45
schema_hlcMethod · 0.45