Loads a component from a path.
Types
use type wasm
from componentized:component/types@0.0.0-dev
The bytes of a WebAssembly binary, a component unless stated otherwise.
list<u8>
use variant error-code
from componentized:component/types@0.0.0-dev
An error from a call.
malformed:malformedA value cannot be parsed to its expected type.
not-component:option<string>A wasm that must be a component is not, e.g. a core module. Calls accepting multiple wasms name the one that is not a component.
not-found:option<string>The item does not exist, optionally naming it, e.g. a path, URL, reference or package.
other:option<string>Any other error, with an optional message.
Functions
load: async func(path: string) -> result<wasm, error-code>since 0.0.0-dev
Loads the component at path. The forms of path supported depend on the
implementation, e.g. a filesystem path, an HTTP URL or an OCI reference.
WIT
/// Loads a component from a path.
@since(version = 0.0.0-dev)
interface path-loader {
use types.{wasm, error-code};
/// Loads the component at `path`. The forms of path supported depend on the
/// implementation, e.g. a filesystem path, an HTTP URL or an OCI reference.
@since(version = 0.0.0-dev)
load: async func(path: string) -> result<wasm, error-code>;
}