diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2026-08-24 15:47:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-24 15:47:05 +0200 |
| commit | 7b9b3ec681e68280399d9c67e01433c2d3acb6c2 (patch) | |
| tree | b6000a9755d50fe1ba6f93de6ed784deb179ae49 /examples/archive.rs | |
| parent | 3e2e964f70e6128b891fa3b43f73a821493bd7bc (diff) | |
feat: add host typed reference / gc APIs (#54)
- add Store-aware handles for references, GC objects, and exceptions
- simplify host value conversion, rooting, and exception propagation
- update examples, tests, and documentation
- Remove deprecated APIs
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'examples/archive.rs')
| -rw-r--r-- | examples/archive.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/archive.rs b/examples/archive.rs index 3f64704..3f118f2 100644 --- a/examples/archive.rs +++ b/examples/archive.rs @@ -11,13 +11,13 @@ const WASM: &str = r#" "#; fn main() -> Result<()> { - let wasm = wat::parse_str(WASM).expect("Failed to parse WAT"); + let wasm = wat::parse_str(WASM)?; let module = Parser::default().parse_module_bytes(wasm)?; - let twasm = module.serialize_twasm()?; - // Now, you could e.g. write `twasm` to a file called `add.twasm` - // and load it later in a different program. + // Serialize the optimized module for storage or distribution. + let twasm = module.serialize_twasm()?; + // Archived modules load without parsing Wasm again and should only come from trusted sources. let module = Module::try_from_twasm(&twasm)?; let mut store = Store::default(); let instance = ModuleInstance::instantiate(&mut store, &module, None)?; |
