pub struct WasmPluginRegistry { /* private fields */ }Expand description
Registry for WASM plugins
Thread-safe registry that manages plugin lifecycle and provides fast lookup for plugin invocation.
Implementations§
Source§impl WasmPluginRegistry
impl WasmPluginRegistry
Sourcepub fn load(
&self,
name: &str,
wasm_bytes: &[u8],
config: WasmInstanceConfig,
) -> KernelResult<()>
pub fn load( &self, name: &str, wasm_bytes: &[u8], config: WasmInstanceConfig, ) -> KernelResult<()>
Load a plugin from WASM bytes
Sourcepub fn load_from_file(
&self,
name: &str,
path: &Path,
config: WasmInstanceConfig,
) -> KernelResult<()>
pub fn load_from_file( &self, name: &str, path: &Path, config: WasmInstanceConfig, ) -> KernelResult<()>
Load a plugin from a file
Sourcepub fn unload(&self, name: &str) -> KernelResult<()>
pub fn unload(&self, name: &str) -> KernelResult<()>
Unload a plugin
Sourcepub fn call(
&self,
plugin_name: &str,
func_name: &str,
args: &[WasmValue],
) -> KernelResult<Vec<WasmValue>>
pub fn call( &self, plugin_name: &str, func_name: &str, args: &[WasmValue], ) -> KernelResult<Vec<WasmValue>>
Call a function on a plugin
Sourcepub fn global_stats(&self) -> (u64, u64)
pub fn global_stats(&self) -> (u64, u64)
Get global statistics
Sourcepub fn shutdown_all(&self) -> KernelResult<()>
pub fn shutdown_all(&self) -> KernelResult<()>
Shutdown all plugins in reverse load order
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WasmPluginRegistry
impl !RefUnwindSafe for WasmPluginRegistry
impl Send for WasmPluginRegistry
impl Sync for WasmPluginRegistry
impl Unpin for WasmPluginRegistry
impl UnsafeUnpin for WasmPluginRegistry
impl !UnwindSafe for WasmPluginRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more