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

Method register_native_module

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

Source from the content-addressed store, hash-verified

138 }
139
140 pub fn register_native_module(&mut self, name: InternedString<'gc>, module: ModuleKind<'gc>) {
141 if !name.to_str().unwrap().starts_with("std.") {
142 panic!("Native modules must have names starting with 'std.'");
143 }
144 #[cfg(feature = "debug")]
145 println!("Registering native module {}", module.debug_info());
146 self.modules.insert(name, module);
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.") {

Callers 1

init_stdlibMethod · 0.80

Calls 1

to_strMethod · 0.80

Tested by

no test coverage detected