| Copyright | (c) 2026 Tushar Adhatrao |
|---|---|
| License | MIT |
| Stability | stable |
| Safe Haskell | None |
| Language | GHC2021 |
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
- loadPluginsWithDefaultPaths :: IO ()
- loadPluginFromPath :: FilePath -> IO ()
- listPlugins :: IO [Text]
- findPlugin :: Text -> IO (Maybe Plugin)
- newtype Plugin = Plugin (BorrowedCtx PluginTag)
- getPluginName :: Plugin -> IO Text
- listPluginModules :: Plugin -> IO [Text]
- createPluginModule :: Plugin -> Text -> IO (Maybe ModuleInstance)
- initWASINN :: [Text] -> IO ()
- unsafePluginPtr :: Plugin -> Ptr PluginTag
- borrowPlugin :: Ptr PluginTag -> IO Plugin
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
A loaded WasmEdge plugin. Plugins are managed by the global runtime and referenced as borrowed contexts.
Constructors
| Plugin (BorrowedCtx PluginTag) |
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.