What is the difference between wasmtime::Linker
and wasmtime::component::Linker
?
wasmtime_wasi::preview1::add_to_linker_async
expects a wasmtime::Linker
, but wasmtime_wasi_http::add_only_http_to_linker_async
expects a wasmtime::component::Linker
. I'm not sure how to make these work together?
wasmtime::Linker is for core wasm modules, while wasmtime::component::Linker is for wasm components.
wasip1 uses core wasm, while wasi-http is part of wasip2 which uses wasm components.
If you want to use wasi-http you will have to build your wasm module for wasip2 and use wasmtime_wasi::add_to_linker_async with a wasmtime::component::Linker.
For resources on what components are and what the component model is:
Component Model Book
CM explainer (other good docs in there -- repo root is worth looking at!)
WebAssembly Interface Types ("WIT")
Makes sense, thank you! Appreciate the resources @Victor Adossi
Last updated: Dec 23 2024 at 14:03 UTC