pub struct WasmPlugin { /* private fields */ }Expand description
WASM Plugin
Implementations§
Source§impl WasmPlugin
impl WasmPlugin
Sourcepub fn from_bytes(
engine: &Engine,
bytes: &[u8],
config: WasmPluginConfig,
) -> WasmResult<Self>
pub fn from_bytes( engine: &Engine, bytes: &[u8], config: WasmPluginConfig, ) -> WasmResult<Self>
Create a new WASM plugin from module bytes
Sourcepub fn from_bytes_with_async(
engine: &Engine,
bytes: &[u8],
config: WasmPluginConfig,
async_support: bool,
) -> WasmResult<Self>
pub fn from_bytes_with_async( engine: &Engine, bytes: &[u8], config: WasmPluginConfig, async_support: bool, ) -> WasmResult<Self>
Create a new WASM plugin from module bytes with async support flag
Sourcepub fn from_wat(
engine: &Engine,
wat: &str,
config: WasmPluginConfig,
) -> WasmResult<Self>
pub fn from_wat( engine: &Engine, wat: &str, config: WasmPluginConfig, ) -> WasmResult<Self>
Create from WAT (WebAssembly Text format)
Sourcepub fn from_wat_with_async(
engine: &Engine,
wat: &str,
config: WasmPluginConfig,
async_support: bool,
) -> WasmResult<Self>
pub fn from_wat_with_async( engine: &Engine, wat: &str, config: WasmPluginConfig, async_support: bool, ) -> WasmResult<Self>
Create from WAT with async support flag
Sourcepub fn from_file(
engine: &Engine,
path: &Path,
config: WasmPluginConfig,
) -> WasmResult<Self>
pub fn from_file( engine: &Engine, path: &Path, config: WasmPluginConfig, ) -> WasmResult<Self>
Create from file path
Sourcepub fn manifest(&self) -> &PluginManifest
pub fn manifest(&self) -> &PluginManifest
Get plugin manifest
Sourcepub async fn state(&self) -> WasmPluginState
pub async fn state(&self) -> WasmPluginState
Get current state
Sourcepub async fn metrics(&self) -> PluginMetrics
pub async fn metrics(&self) -> PluginMetrics
Get metrics
Sourcepub async fn initialize(&self) -> WasmResult<()>
pub async fn initialize(&self) -> WasmResult<()>
Initialize the plugin
Sourcepub async fn has_export(&self, name: &str) -> bool
pub async fn has_export(&self, name: &str) -> bool
Check if export exists
Sourcepub async fn call_i32(&self, name: &str, args: &[Val]) -> WasmResult<i32>
pub async fn call_i32(&self, name: &str, args: &[Val]) -> WasmResult<i32>
Call a function with i32 return value
Sourcepub async fn call_i64(&self, name: &str, args: &[Val]) -> WasmResult<i64>
pub async fn call_i64(&self, name: &str, args: &[Val]) -> WasmResult<i64>
Call a function with i64 return value
Sourcepub async fn stop(&self) -> WasmResult<()>
pub async fn stop(&self) -> WasmResult<()>
Stop the plugin
Sourcepub fn from_parts(
id: String,
config: WasmPluginConfig,
manifest: PluginManifest,
module: Module,
engine: Engine,
host_context: Arc<HostContext>,
) -> Self
pub fn from_parts( id: String, config: WasmPluginConfig, manifest: PluginManifest, module: Module, engine: Engine, host_context: Arc<HostContext>, ) -> Self
Create plugin from pre-existing parts (used by runtime)
Sourcepub fn from_parts_with_async(
id: String,
config: WasmPluginConfig,
manifest: PluginManifest,
module: Module,
engine: Engine,
host_context: Arc<HostContext>,
async_support: bool,
) -> Self
pub fn from_parts_with_async( id: String, config: WasmPluginConfig, manifest: PluginManifest, module: Module, engine: Engine, host_context: Arc<HostContext>, async_support: bool, ) -> Self
Create plugin from pre-existing parts with async support flag
Auto Trait Implementations§
impl !Freeze for WasmPlugin
impl !RefUnwindSafe for WasmPlugin
impl Send for WasmPlugin
impl Sync for WasmPlugin
impl Unpin for WasmPlugin
impl UnsafeUnpin for WasmPlugin
impl !UnwindSafe for WasmPlugin
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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