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

Method get_or_create

nodedb-graph/src/sharded.rs:82–84  ·  view source on GitHub ↗

Mutable access to a tenant's partition, creating an empty one on first use. This is the canonical write-path entry point: insertion handlers call this once to resolve the partition, then operate on the returned `&mut CsrIndex` exactly as they would on a standalone instance.

(&mut self, tid: TenantId)

Source from the content-addressed store, hash-verified

80 /// returned `&mut CsrIndex` exactly as they would on a standalone
81 /// instance.
82 pub fn get_or_create(&mut self, tid: TenantId) -> &mut CsrIndex {
83 self.partitions.entry(tid).or_default()
84 }
85
86 /// Drop a tenant's entire graph state.
87 ///

Calls 1

entryMethod · 0.80