MCPcopy Create free account
hub / github.com/hashintel/hash / register

Method register

libs/@local/hashql/core/src/module/mod.rs:125–135  ·  view source on GitHub ↗

Register a new module in the root namespace. # Panics This function will panic if the internal `RwLock` is poisoned.

(&self, module: ModuleId)

Source from the content-addressed store, hash-verified

123 ///
124 /// This function will panic if the internal `RwLock` is poisoned.
125 pub fn register(&self, module: ModuleId) {
126 let module = self.modules.index(module);
127
128 if cfg!(debug_assertions) {
129 assert_eq!(module.parent, ModuleId::ROOT);
130 }
131
132 let mut root = self.root.write().expect("lock should not be poisoned");
133 root.insert(module.name, module.id);
134 drop(root);
135 }
136
137 /// Find an item by name in the root namespace.
138 ///

Callers 4

newMethod · 0.45
module_empty_errorFunction · 0.45
shadowed_importFunction · 0.45
registerOpenTelemetryFunction · 0.45

Calls 4

indexMethod · 0.45
expectMethod · 0.45
writeMethod · 0.45
insertMethod · 0.45

Tested by 2

module_empty_errorFunction · 0.36
shadowed_importFunction · 0.36