pub struct VMOpaqueContext { /* private fields */ }
Expand description

An “opaque” version of VMContext which must be explicitly casted to a target context.

This context is used to represent that contexts specified in VMCallerCheckedAnyfunc can have any type and don’t have an implicit structure. Neither wasmtime nor cranelift-generated code can rely on the structure of an opaque context in general and only the code which configured the context is able to rely on a particular structure. This is because the context pointer configured for VMCallerCheckedAnyfunc is guaranteed to be the first parameter passed.

Note that Wasmtime currently has a layout where all contexts that are casted to an opaque context start with a 32-bit “magic” which can be used in debug mode to debug-assert that the casts here are correct and have at least a little protection against incorrect casts.

Implementations

Helper function to clearly indicate that casts are desired.

Helper function to clearly indicate that casts are desired.

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.