pub struct WasmGuestExecutor { /* private fields */ }Expand description
Guest-module backend for precompiled .wasm modules.
Executes guest modules through a constrained runtime with a narrow host ABI.
This is clearly separate from raw JavaScript source execution — it accepts
only ExecutionPayload::GuestModule payloads with GuestModuleFormat::Wasm.
§Important Distinction
WasmGuestExecutor is NOT a JavaScript executor. It runs precompiled
WebAssembly binary modules. For JavaScript source execution, use
[crate::EmbeddedJsExecutor] (secondary scripting) or
crate::ContainerCommandExecutor (container-isolated Node.js).
§Example
use adk_code::{CodeExecutor, WasmGuestExecutor, ExecutionLanguage};
let executor = WasmGuestExecutor::new();
assert!(executor.supports_language(&ExecutionLanguage::Wasm));
assert!(!executor.supports_language(&ExecutionLanguage::JavaScript));
assert!(!executor.supports_language(&ExecutionLanguage::Rust));Implementations§
Source§impl WasmGuestExecutor
impl WasmGuestExecutor
Sourcepub fn with_config(config: WasmGuestConfig) -> Self
pub fn with_config(config: WasmGuestConfig) -> Self
Create a new WASM guest executor with the given configuration.
Trait Implementations§
Source§impl Clone for WasmGuestExecutor
impl Clone for WasmGuestExecutor
Source§fn clone(&self) -> WasmGuestExecutor
fn clone(&self) -> WasmGuestExecutor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CodeExecutor for WasmGuestExecutor
impl CodeExecutor for WasmGuestExecutor
Source§fn capabilities(&self) -> BackendCapabilities
fn capabilities(&self) -> BackendCapabilities
The capabilities this backend can enforce.
Source§fn supports_language(&self, lang: &ExecutionLanguage) -> bool
fn supports_language(&self, lang: &ExecutionLanguage) -> bool
Whether this backend supports the given language.
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
request: ExecutionRequest,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
request: ExecutionRequest,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute a request and return a structured result.
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the execution environment (e.g., create and start a container). Read more
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the execution environment and release resources. Read more
Source§impl Debug for WasmGuestExecutor
impl Debug for WasmGuestExecutor
Auto Trait Implementations§
impl Freeze for WasmGuestExecutor
impl RefUnwindSafe for WasmGuestExecutor
impl Send for WasmGuestExecutor
impl Sync for WasmGuestExecutor
impl Unpin for WasmGuestExecutor
impl UnsafeUnpin for WasmGuestExecutor
impl UnwindSafe for WasmGuestExecutor
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