Struct wasmedge_sys::plugin::PluginManager
source · pub struct PluginManager {}
Expand description
Defines the APIs for loading plugins and check the basic information of the loaded plugins.
Implementations§
source§impl PluginManager
impl PluginManager
sourcepub fn load_plugins_from_default_paths()
pub fn load_plugins_from_default_paths()
Load plugins from the default path. The default plugin path could be one of the following:
-
The environment variable “WASMEDGE_PLUGIN_PATH”.
-
The
../plugin/
directory related to the WasmEdge installation path. -
The
wasmedge/
directory under the library path if the WasmEdge is installed under the “/usr”.
sourcepub fn load_plugins(path: impl AsRef<Path>) -> WasmEdgeResult<()>
pub fn load_plugins(path: impl AsRef<Path>) -> WasmEdgeResult<()>
Load a single or multiple plugins from a given path.
-
If the path is pointing at a file , then it indicates that a single plugin will be loaded from the file.
-
If the path is pointing at a directory, then the method will load plugins from the files in the directory.
Argument
param
- A path to a plugin file or a directory holding plugin files.
Error
- If the path contains invalid characters, then an WasmEdgeError::FoundNulByte error is returned.
pub fn nn_preload(preloads: Vec<&str>)
wasi_nn
only.sourcepub fn find(name: impl AsRef<str>) -> WasmEdgeResult<Plugin>
pub fn find(name: impl AsRef<str>) -> WasmEdgeResult<Plugin>
Returns the target plugin by its name.
Argument
name
- The name of the target plugin.
Error
If not found the plugin, then return PluginError::NotFound error.
sourcepub fn init_wasmedge_process(allowed_cmds: Option<Vec<&str>>, allowed: bool)
Available on Linux and crate feature wasmedge_process
and non-crate feature static
only.
pub fn init_wasmedge_process(allowed_cmds: Option<Vec<&str>>, allowed: bool)
wasmedge_process
and non-crate feature static
only.Initializes the wasmedge_process
plugin module instance with the parameters.
Arguments
-
allowed_cmds
- A white list of commands. -
allowed
- Determines if wasmedge_process is allowed to execute all commands on the white list.