MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / register_script_module

Method register_script_module

aiscript-vm/src/module.rs:149–156  ·  view source on GitHub ↗
(&mut self, name: InternedString<'gc>, module: ModuleKind<'gc>)

Source from the content-addressed store, hash-verified

147 }
148
149 pub fn register_script_module(&mut self, name: InternedString<'gc>, module: ModuleKind<'gc>) {
150 if name.to_str().unwrap().starts_with("std.") {
151 panic!("Script modules cannot have names starting with 'std.'");
152 }
153 #[cfg(feature = "debug")]
154 println!("Registering script module {}", module.debug_info());
155 self.modules.insert(name, module);
156 }
157
158 pub fn get_module(&self, name: InternedString<'gc>) -> Option<&ModuleKind<'gc>> {
159 self.modules.get(&name)

Callers 1

import_moduleMethod · 0.80

Calls 1

to_strMethod · 0.80

Tested by

no test coverage detected