pub struct PluginLoader { /* private fields */ }Expand description
WASM Plugin Loader
Loads WASM mutation plugins and provides access to their exported functions. Thread-safe and can be shared across threads.
§Security
- Fuel limits prevent infinite loops (10M instructions)
- Stack size limits prevent stack overflow (1MB)
- WASI sandbox restricts filesystem/network access
Implementations§
Source§impl PluginLoader
impl PluginLoader
Sourcepub fn new() -> Result<Self, LoaderError>
pub fn new() -> Result<Self, LoaderError>
Create a new plugin loader with default security settings
Configures:
- Component model support (for WIT)
- Fuel limits (CPU usage)
- Stack limits (1MB)
- WASI support (minimal sandbox)
Sourcepub fn load(&self, wasm_bytes: &[u8]) -> Result<LoadedPlugin, LoaderError>
pub fn load(&self, wasm_bytes: &[u8]) -> Result<LoadedPlugin, LoaderError>
Load a WASM mutation plugin from bytes
Steps:
- Parse WASM component
- Instantiate with fuel limit
- Call get-manifest()
- Validate API version
- Call get-pattern-source()
- Return LoadedPlugin
Auto Trait Implementations§
impl Freeze for PluginLoader
impl !RefUnwindSafe for PluginLoader
impl Send for PluginLoader
impl Sync for PluginLoader
impl Unpin for PluginLoader
impl UnsafeUnpin for PluginLoader
impl !UnwindSafe for PluginLoader
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