pub struct PluginRuntime { /* private fields */ }Expand description
WASM plugin runtime with mandatory resource limits.
Implementations§
Source§impl PluginRuntime
impl PluginRuntime
Sourcepub fn new(config: ToolRuntimeConfig) -> Self
pub fn new(config: ToolRuntimeConfig) -> Self
Create a new runtime with the given configuration.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a runtime with default security limits.
Sourcepub fn execute(
&self,
wasm_bytes: &[u8],
tool_name: &str,
input_json: &str,
callbacks: HostCallbacks,
) -> Result<RunResult, RuntimeError>
pub fn execute( &self, wasm_bytes: &[u8], tool_name: &str, input_json: &str, callbacks: HostCallbacks, ) -> Result<RunResult, RuntimeError>
Execute a tool in a WASM module with host callbacks.
Auto Trait Implementations§
impl Freeze for PluginRuntime
impl RefUnwindSafe for PluginRuntime
impl Send for PluginRuntime
impl Sync for PluginRuntime
impl Unpin for PluginRuntime
impl UnsafeUnpin for PluginRuntime
impl UnwindSafe for PluginRuntime
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