MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / set_parent

Method set_parent

atomic-core/src/apply/workspace.rs:570–573  ·  view source on GitHub ↗

Set the parent of a position.

(&mut self, child: Position<NodeId>, parent: Position<NodeId>)

Source from the content-addressed store, hash-verified

568
569 /// Set the parent of a position.
570 pub fn set_parent(&mut self, child: Position<NodeId>, parent: Position<NodeId>) {
571 self.parents.insert(child, parent);
572 self.children.entry(parent).or_default().push(child);
573 }
574
575 /// Get the parent of a position.
576 pub fn get_parent(&self, child: &Position<NodeId>) -> Option<Position<NodeId>> {

Callers 2

Calls 2

insertMethod · 0.45
pushMethod · 0.45

Tested by 2