pub struct WasmInvokeHandler { /* private fields */ }Expand description
Sandboxed WASM handler that implements crate::server::InvokeHandler.
The handler holds a Wasmtime Engine, a background epoch-ticker thread,
and a Mutex protecting the Store and component instance. Calls are
serialised by the mutex; the first version does not support parallel
invocation.
Implementations§
Source§impl WasmInvokeHandler
impl WasmInvokeHandler
Sourcepub fn new(
pack: &LoadedHandlerPack,
model_json: &Value,
) -> Result<Self, HandlerLoadError>
pub fn new( pack: &LoadedHandlerPack, model_json: &Value, ) -> Result<Self, HandlerLoadError>
Load and instantiate a signed handler pack.
Verifies that guest metadata() matches the signed manifest, then calls
configure() with the canonical model JSON. Returns an error if any
step fails; no partial state is retained.
The epoch ticker is started before component instantiation so that
metadata(), configure() and every later invoke() all run under
the same wall-clock deadline. Fuel is reset before each call so the
budgets do not pool across stages.
Trait Implementations§
Source§impl Debug for WasmInvokeHandler
impl Debug for WasmInvokeHandler
Source§impl InvokeHandler for WasmInvokeHandler
impl InvokeHandler for WasmInvokeHandler
Auto Trait Implementations§
impl !Freeze for WasmInvokeHandler
impl !RefUnwindSafe for WasmInvokeHandler
impl !UnwindSafe for WasmInvokeHandler
impl Send for WasmInvokeHandler
impl Sync for WasmInvokeHandler
impl Unpin for WasmInvokeHandler
impl UnsafeUnpin for WasmInvokeHandler
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