#[repr(C)]
pub struct VMHostFuncContext { /* private fields */ }
Expand description

The VM*Context for host functions.

Its magic field must always be wasmtime_environ::VM_HOST_FUNC_MAGIC, and this is how you can determine whether a VM*Context is a VMHostFuncContext versus a different kind of context.

Implementations

Create the context for the given host function.

Safety

The host_func must be a pointer to a host (not Wasm) function and it must be Send and Sync.

Get the Wasm-to-host trampoline for this host function context.

Get the host state for this host function context.

Helper function to cast between context types using a debug assertion to protect against some mistakes.

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.