MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / define

Method define

crates/tinywasm/src/imports.rs:141–145  ·  view source on GitHub ↗

Define an import value.

(&mut self, module: &str, name: &str, value: impl Into<Extern>)

Source from the content-addressed store, hash-verified

139
140 /// Define an import value.
141 pub fn define(&mut self, module: &str, name: &str, value: impl Into<Extern>) -> &mut Self {
142 let name = ExternName { module: module.to_string(), name: name.to_string() };
143 self.externs.insert(name, value.into());
144 self
145 }
146
147 pub(crate) fn take_defined(&self, import: &Import) -> Option<Extern> {
148 let name = ExternName::from(import);

Callers 15

tinywasmFunction · 0.80
tinywasm_no_stdFunction · 0.80
helloFunction · 0.80
host_fnFunction · 0.80
printi32Function · 0.80
mainFunction · 0.80
runFunction · 0.80
runFunction · 0.80
build_importsFunction · 0.80
importsMethod · 0.80

Calls

no outgoing calls