|
Wasmtime
|
Class used to instantiate a Component into an instance.
More...
#include <linker.hh>
Public Member Functions | |
| Linker (Engine &engine) | |
| Creates a new linker which will instantiate in the given engine. | |
| LinkerInstance | root () |
| Gets the "root" instance of this linker which can be used to define items into the linker under the top-level namespace. More... | |
| void | allow_shadowing (bool allow) |
| Result< Instance > | instantiate (Store::Context cx, Component &component) |
| Instantiates the given component within this linker. | |
| Result< std::monostate > | add_wasip2 () |
| Adds WASIp2 API definitions to this linker. More... | |
| const wasmtime_component_linker_t * | capi () const |
| Returns the underlying C API pointer. | |
| wasmtime_component_linker_t * | capi () |
| Returns the underlying C API pointer. | |
Class used to instantiate a Component into an instance.
|
inline |
Adds WASIp2 API definitions to this linker.
This will use the WASIp2 API definitions in Wasmtime to this linker. Note that this adds synchronous versions of WASIp2 definitions which will block the caller when invoked. Internally this will use Wasmtime's default async runtime implemented with Tokio to handle async I/O.
|
inline |
Configures whether shadowing previous names is allowed or not.
By default shadowing is not allowed.
|
inline |
Gets the "root" instance of this linker which can be used to define items into the linker under the top-level namespace.
This Linker cannot be used while the returned LinkerInstance is in scope. To use more methods on this Linker it's required that the instance returned here is dropped first.