(&self, mut node: Node)
| 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")?; |