MCPcopy Create free account
hub / github.com/awslabs/llrt / with_module

Method with_module

llrt_modules/src/module_builder.rs:206–215  ·  view source on GitHub ↗
(mut self, module: I)

Source from the content-addressed store, hash-verified

204 }
205
206 pub fn with_module<M: ModuleDef, I: Into<ModuleInfo<M>>>(mut self, module: I) -> Self {
207 let module_info: ModuleInfo<M> = module.into();
208
209 self.module_resolver = self.module_resolver.add_name(module_info.name);
210 self.module_loader = self
211 .module_loader
212 .with_module(module_info.name, module_info.module);
213 self.global_attachment = self.global_attachment.add_name(module_info.name);
214 self
215 }
216
217 pub fn with_global(mut self, init: fn(&Ctx<'_>) -> Result<()>) -> Self {
218 self.global_attachment = self.global_attachment.add_function(init);

Callers 1

defaultMethod · 0.45

Calls 1

add_nameMethod · 0.45

Tested by

no test coverage detected