Back to Wasmtime

Working with `externref`

docs/examples-externref.md

44.0.1857 B
Original Source

Working with externref

You can also browse this source code online and clone the wasmtime repository to run the example locally:

This example shows how to pass opaque host references into and out of WebAssembly using externref.

Wasm Source

wat
{{#include ../examples/externref.wat}}

Host Source

<!-- langtabs-start -->
rust
{{#include ../examples/externref.rs}}
c
{{#include ../examples/externref.c}}
cpp
{{#include ../examples/externref.cc}}
<!-- langtabs-end -->