Load a parent→child edge into the hierarchy.
(&mut self, tenant_id: u64, child_id: &str, parent_id: &str)
| 72 | |
| 73 | /// Load a parent→child edge into the hierarchy. |
| 74 | pub fn put_edge(&mut self, tenant_id: u64, child_id: &str, parent_id: &str) { |
| 75 | let tenant = self.tenants.entry(tenant_id).or_default(); |
| 76 | tenant |
| 77 | .parent_map |
| 78 | .insert(child_id.to_owned(), parent_id.to_owned()); |
| 79 | tenant |
| 80 | .children_map |
| 81 | .entry(parent_id.to_owned()) |
| 82 | .or_default() |
| 83 | .insert(child_id.to_owned()); |
| 84 | } |
| 85 | |
| 86 | /// Remove a parent→child edge from the hierarchy. |
| 87 | pub fn remove_edge(&mut self, tenant_id: u64, child_id: &str) { |