pub struct WasmInstance { /* private fields */ }Expand description
A loaded WASM module + its store, exposed through SandboxInstance.
Each call instantiates the pre-linked module against the current
store so the capability state currently installed on HostState
is the one the guest sees. Instantiation from InstancePre is
cheap (the costly step is pre-linking, done once at load time).
Trait Implementations§
Source§impl SandboxInstance for WasmInstance
impl SandboxInstance for WasmInstance
Source§fn call(&mut self, function: &str, args: &[Value]) -> Result<Vec<Value>>
fn call(&mut self, function: &str, args: &[Value]) -> Result<Vec<Value>>
Invoke
function with args. Returns the function’s results.Source§fn grant_capability(&mut self, cap: Capability) -> Result<()>
fn grant_capability(&mut self, cap: Capability) -> Result<()>
Grant
cap to this instance. Grants are idempotent.Source§fn revoke_capability(&mut self, cap: &Capability) -> Result<()>
fn revoke_capability(&mut self, cap: &Capability) -> Result<()>
Revoke the matching capability. Revokes are idempotent.
Auto Trait Implementations§
impl !RefUnwindSafe for WasmInstance
impl !UnwindSafe for WasmInstance
impl Freeze for WasmInstance
impl Send for WasmInstance
impl Sync for WasmInstance
impl Unpin for WasmInstance
impl UnsafeUnpin for WasmInstance
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