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

Method put_edge

nodedb/src/control/security/permission_tree/cache.rs:74–84  ·  view source on GitHub ↗

Load a parent→child edge into the hierarchy.

(&mut self, tenant_id: u64, child_id: &str, parent_id: &str)

Source from the content-addressed store, hash-verified

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) {

Callers 6

on_edge_upsertFunction · 0.80
setupFunction · 0.80
load_edgesMethod · 0.80
edge_hierarchyFunction · 0.80
remove_edgeFunction · 0.80
tenant_isolationFunction · 0.80

Calls 2

entryMethod · 0.80
insertMethod · 0.45

Tested by 3

edge_hierarchyFunction · 0.64
remove_edgeFunction · 0.64
tenant_isolationFunction · 0.64