pub struct WasmPlugin { /* private fields */ }Expand description
A loaded WebAssembly plugin. Cheap to clone; safe to share across runs and threads.
Implementations§
Source§impl WasmPlugin
impl WasmPlugin
Sourcepub fn load(bytes: &[u8], limits: WasmLimits) -> Result<Self, WasmError>
pub fn load(bytes: &[u8], limits: WasmLimits) -> Result<Self, WasmError>
Validate, compile and describe a module from memory.
Sourcepub fn load_file(
path: impl AsRef<Path>,
limits: WasmLimits,
) -> Result<Self, WasmError>
pub fn load_file( path: impl AsRef<Path>, limits: WasmLimits, ) -> Result<Self, WasmError>
Read and load a .wasm file.
Sourcepub fn descriptors(&self) -> Vec<NodeDescriptor>
pub fn descriptors(&self) -> Vec<NodeDescriptor>
Catalog descriptors of every node kind in the plugin.
Sourcepub fn limits(&self) -> &WasmLimits
pub fn limits(&self) -> &WasmLimits
Limits applied to calls.
Trait Implementations§
Source§impl Clone for WasmPlugin
impl Clone for WasmPlugin
Auto Trait Implementations§
impl !RefUnwindSafe for WasmPlugin
impl !UnwindSafe for WasmPlugin
impl Forget for WasmPlugin
impl Freeze for WasmPlugin
impl Move for WasmPlugin
impl Send for WasmPlugin
impl Sync for WasmPlugin
impl Unpin for WasmPlugin
impl UnsafeUnpin 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