summaryrefslogtreecommitdiff
path: root/examples/linking.rs
diff options
context:
space:
mode:
authorHenry <mail@henrygressmann.de>2026-04-12 13:34:31 +0200
committerHenry <mail@henrygressmann.de>2026-04-12 13:34:31 +0200
commitdcd8b152466ab023762e4b9b6fc50c99da0cae50 (patch)
tree391486a6a7edc56eb2a9135f295c270634ad3247 /examples/linking.rs
parent87499c635504e808960e0c6ffffe2b43ca4d6206 (diff)
feat: rework public api, add missing export apis
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'examples/linking.rs')
-rw-r--r--examples/linking.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/linking.rs b/examples/linking.rs
index f94773a..ce9748b 100644
--- a/examples/linking.rs
+++ b/examples/linking.rs
@@ -37,13 +37,13 @@ fn main() -> Result<()> {
// Link the `adder` namespace to the `add` module's instance.
let mut imports = tinywasm::Imports::new();
- imports.link_module("adder", add_instance.id())?;
+ imports.link_module("adder", add_instance)?;
// Instantiate the `import` module with the linked imports.
let import_instance = import_module.instantiate(&mut store, Some(imports))?;
// Call the `main` function, which uses the imported `add` function.
- let main = import_instance.exported_func::<(), i32>(&store, "main")?;
+ let main = import_instance.func_typed::<(), i32>(&store, "main")?;
assert_eq!(main.call(&mut store, ())?, 3);
Ok(())