wasmedge-hs-0.17.1.0: Haskell bindings for the WasmEdge WebAssembly runtime
Copyright(c) 2026 Tushar Adhatrao
LicenseMIT
Stabilitystable
Safe HaskellNone
LanguageGHC2021

WasmEdge.Plugin

Description

The WasmEdge plugin system allows loading native dynamic libraries that provide custom host modules (such as WASI-NN, WASI-Crypto, etc.).

Synopsis

Plugin discovery & loading

loadPluginsWithDefaultPaths :: IO () #

Load all plugins from the default search paths (e.g., $WASMEDGE_PLUGIN_PATH).

loadPluginFromPath :: FilePath -> IO () #

Load a specific plugin library from a given file path.

listPlugins :: IO [Text] #

List names of all currently loaded plugins.

findPlugin :: Text -> IO (Maybe Plugin) #

Find a loaded plugin by name. Returns Nothing if not loaded.

Plugin operations

newtype Plugin #

A loaded WasmEdge plugin. Plugins are managed by the global runtime and referenced as borrowed contexts.

Constructors

Plugin (BorrowedCtx PluginTag) 

Instances

Instances details
Eq Plugin # 
Instance details

Defined in WasmEdge.Plugin

Methods

(==) :: Plugin -> Plugin -> Bool #

(/=) :: Plugin -> Plugin -> Bool #

getPluginName :: Plugin -> IO Text #

Get the name of a plugin.

listPluginModules :: Plugin -> IO [Text] #

List all module names provided by this plugin.

createPluginModule :: Plugin -> Text -> IO (Maybe ModuleInstance) #

Create a ModuleInstance provided by this plugin under the given module name.

WASI-NN specific initialization

initWASINN :: [Text] -> IO () #

Initialize WASI-NN with pre-loaded neural network model paths.

Internal / borrowed pointers

unsafePluginPtr :: Plugin -> Ptr PluginTag #

Extract the raw pointer of a Plugin.

borrowPlugin :: Ptr PluginTag -> IO Plugin #

Construct a borrowed Plugin from a raw pointer.