Skip to main content

Module plugin

Module plugin 

Source
Expand description

Plugin system for extending host capabilities.

This module provides the plugin framework that allows the wasmcloud host to support different WASI interfaces and capabilities. Plugins implement specific functionality that components can use through standard interfaces.

§Plugin Architecture

Plugins are Rust types that implement the HostPlugin trait. They:

  • Declare which WIT interfaces they provide via HostPlugin::world
  • Bind to components that need their capabilities via [HostPlugin::bind_component]
  • Can participate in workload lifecycle events
  • Are automatically linked into the wasmtime runtime

§Built-in Plugins

The crate provides several built-in plugins for common WASI interfaces:

Modules§

wasi_blobstore
WASI Blobstore Memory Plugin
wasi_config
Runtime configuration plugin for WebAssembly components.
wasi_http
HTTP server plugin for handling incoming HTTP requests.
wasi_keyvalue
WASI KeyValue Memory Plugin
wasi_logging
Structured logging plugin for WebAssembly components.

Traits§

HostPlugin
The HostPlugin trait provides an interface for implementing built-in plugins for the host. A plugin is primarily responsible for implementing a specific WitWorld as a collection of imports and exports that will be directly linked to the workload’s wasmtime::component::Linker.