MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / _insert_node

Method _insert_node

crates/standalone/src/control_db.rs:530–542  ·  view source on GitHub ↗
(&self, mut node: Node)

Source from the content-addressed store, hash-verified

528 }
529
530 pub fn _insert_node(&self, mut node: Node) -> Result<u64> {
531 let tree = self.db.open_tree("node")?;
532
533 let id = self.db.generate_id()?;
534
535 node.id = id;
536 let buf = bsatn::to_vec(&node).unwrap();
537
538 tree.insert(id.to_be_bytes(), buf)?;
539 tree.flush()?;
540
541 Ok(id)
542 }
543
544 pub fn _update_node(&self, node: Node) -> Result<()> {
545 let tree = self.db.open_tree("node")?;

Callers

nothing calls this directly

Calls 5

to_vecFunction · 0.85
insertMethod · 0.65
OkFunction · 0.50
unwrapMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected