Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/docs/examples-externref.md
2452 views

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

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

Host Source

{{#include ../examples/externref.rs}}
{{#include ../examples/externref.c}}
{{#include ../examples/externref.cc}}