Wasmtime
wasmtime::component::Linker Class Reference

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< Instanceinstantiate (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_tcapi () const
 Returns the underlying C API pointer.
 
wasmtime_component_linker_tcapi ()
 Returns the underlying C API pointer.
 

Detailed Description

Class used to instantiate a Component into an instance.

Member Function Documentation

◆ add_wasip2()

Result< std::monostate > wasmtime::component::Linker::add_wasip2 ( )
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.

◆ allow_shadowing()

void wasmtime::component::Linker::allow_shadowing ( bool  allow)
inline

Configures whether shadowing previous names is allowed or not.

By default shadowing is not allowed.

◆ root()

LinkerInstance wasmtime::component::Linker::root ( )
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.


The documentation for this class was generated from the following file: