pub struct WasmPluginRuntime;Implementations§
Source§impl WasmPluginRuntime
impl WasmPluginRuntime
pub fn new() -> Self
Sourcepub fn create_engine() -> Result<Engine>
pub fn create_engine() -> Result<Engine>
Create a new WASM engine with fuel metering enabled. Share this across plugins for efficient resource use.
Sourcepub fn compile_module(engine: &Engine, wasm_path: &Path) -> Result<Module>
pub fn compile_module(engine: &Engine, wasm_path: &Path) -> Result<Module>
Pre-compile a WASM module from the given path. The returned module can be reused across multiple executions.
Sourcepub fn execute_v2_precompiled(
engine: &Engine,
module: &Module,
container: &WasmPluginContainer,
input: &str,
options: &WasmV2Options,
policy: &WasmIsolationPolicy,
) -> Result<WasmExecutionResultV2>
pub fn execute_v2_precompiled( engine: &Engine, module: &Module, container: &WasmPluginContainer, input: &str, options: &WasmV2Options, policy: &WasmIsolationPolicy, ) -> Result<WasmExecutionResultV2>
Execute a v2 plugin with a pre-compiled engine and module. This avoids disk I/O and module compilation on the hot path.
pub fn preflight(&self, container: &WasmPluginContainer) -> Result<()>
pub fn preflight_with_policy( &self, container: &WasmPluginContainer, policy: &WasmIsolationPolicy, ) -> Result<()>
pub fn execute( &self, container: &WasmPluginContainer, request: &WasmExecutionRequest, ) -> Result<WasmExecutionResult>
pub fn execute_with_policy( &self, container: &WasmPluginContainer, _request: &WasmExecutionRequest, policy: &WasmIsolationPolicy, ) -> Result<WasmExecutionResult>
pub fn execute_v2( &self, container: &WasmPluginContainer, input: &str, options: &WasmV2Options, ) -> Result<WasmExecutionResultV2>
pub fn execute_v2_with_policy( &self, container: &WasmPluginContainer, input: &str, options: &WasmV2Options, policy: &WasmIsolationPolicy, ) -> Result<WasmExecutionResultV2>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WasmPluginRuntime
impl RefUnwindSafe for WasmPluginRuntime
impl Send for WasmPluginRuntime
impl Sync for WasmPluginRuntime
impl Unpin for WasmPluginRuntime
impl UnsafeUnpin for WasmPluginRuntime
impl UnwindSafe for WasmPluginRuntime
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike + FromFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike + FromFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read more