pub struct TypedResumableCallHostTrap<Results> { /* private fields */ }Expand description
State required to resume a TypedFunc invocation.
Implementations§
Source§impl<Results> TypedResumableCallHostTrap<Results>
impl<Results> TypedResumableCallHostTrap<Results>
Sourcepub fn resume<T>(
self,
ctx: impl AsContextMut<Data = T>,
inputs: &[Val],
) -> Result<TypedResumableCall<Results>, Error>where
Results: WasmResults,
pub fn resume<T>(
self,
ctx: impl AsContextMut<Data = T>,
inputs: &[Val],
) -> Result<TypedResumableCall<Results>, Error>where
Results: WasmResults,
Resumes the call to the TypedFunc with the given inputs.
Returns a resumable handle to the function invocation upon encountering host errors with which it is possible to handle the error and continue the execution as if no error occurred.
§Errors
- If the function resumption returned a Wasm
Error. - If the types or the number of values in
inputsdoes not match the types and number of result values of the erroneous host function.
Methods from Deref<Target = ResumableCallHostTrap>§
Sourcepub fn host_func(&self) -> Func
pub fn host_func(&self) -> Func
Returns the host Func that returned the host error.
§Note
When using ResumableCallHostTrap::resume the inputs
need to match the results of this host function so that
the function invocation can properly resume. For that
number and types of the values provided must match.
Sourcepub fn host_error(&self) -> &Error
pub fn host_error(&self) -> &Error
Returns a shared reference to the encountered host error.
§Note
This is guaranteed to never be a Wasm trap.
Trait Implementations§
Source§impl<Results> Debug for TypedResumableCallHostTrap<Results>
impl<Results> Debug for TypedResumableCallHostTrap<Results>
Auto Trait Implementations§
impl<Results> Freeze for TypedResumableCallHostTrap<Results>
impl<Results> !RefUnwindSafe for TypedResumableCallHostTrap<Results>
impl<Results> Send for TypedResumableCallHostTrap<Results>
impl<Results> Sync for TypedResumableCallHostTrap<Results>
impl<Results> Unpin for TypedResumableCallHostTrap<Results>
impl<Results> !UnwindSafe for TypedResumableCallHostTrap<Results>
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