Struct wasmtime_environ::ModuleEnvironment[][src]

pub struct ModuleEnvironment<'data> { /* fields omitted */ }
Expand description

Object containing the standalone environment information.

Implementations

Allocates the environment data structures.

Translate a wasm module using this environment.

This consumes the ModuleEnvironment and produces a list of ModuleTranslations as well as a TypeTables. The list of module translations corresponds to all wasm modules found in the input data. Note that for MVP modules this will always be a list with one element, but with the module linking proposal this may have many elements.

For the module linking proposal the top-level module is returned as the first return value.

The TypeTables structure returned contains intern’d versions of types referenced from each module translation. This primarily serves as the source of truth for module-linking use cases where modules can refer to other module’s types. All SignatureIndex, ModuleTypeIndex, and InstanceTypeIndex values are resolved through the returned tables.

Trait Implementations

This trait is useful for translate_module because it tells how to translate environment-dependent wasm instructions. These functions should not be called by the user.

Provides the number of types up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

Declares a function signature to the environment.

Declares a module type signature to the environment.

Declares an instance type signature to the environment.

Translates a type index to its signature index, only called for type indices which point to functions. Read more

Translates a type index to its module type index, only called for type indices which point to modules. Read more

Translates a type index to its instance type index, only called for type indices which point to instances. Read more

Provides the number of imports up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

Declares a function import to the environment.

Declares a table import to the environment.

Declares a memory import to the environment.

Declares a global import to the environment.

Declares a module import to the environment.

Declares an instance import to the environment.

Provides the number of defined functions up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

Declares the type (signature) of a local function in the module.

Provides the number of defined tables up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

Declares a table to the environment.

Provides the number of defined memories up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

Declares a memory to the environment

Provides the number of defined globals up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

Declares a global to the environment.

Provides the number of exports up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

Declares a function export to the environment.

Declares a table export to the environment.

Declares a memory export to the environment.

Declares a global export to the environment.

Declares an instance export to the environment.

Declares an instance export to the environment.

Declares the optional start function.

Provides the number of element initializers up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

Fills a declared table with references to functions in the module.

Declare a passive element segment.

Indicates that a declarative element segment was seen in the wasm module. Read more

Indicates how many functions the code section reports and the byte offset of where the code sections starts. Read more

Provides the contents of a function body.

Provides the number of data initializers up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

Fills a declared memory with bytes at module instantiation.

Provides the number of passive data segments up front. Read more

Declare a passive data segment.

Declares the name of a module to the environment. Read more

Declares the name of a function to the environment. Read more

Declares the name of a function’s local to the environment. Read more

Indicates that a custom section has been found in the wasm file

Returns the list of enabled wasm features this translation will be using.

Indicates that this module will have amount submodules. Read more

Called at the beginning of translating a module. Read more

Called at the end of translating a module. Read more

Indicates that this module will have amount instances.

Declares a new instance which this module will instantiate before it’s instantiated. Read more

Declares a new alias being added to this module. Read more

Declares an event import to the environment.

Notifies the implementation that all imports have been declared.

Provides the number of defined events up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

Declares an event to the environment

Declares an event export to the environment.

Notifies the implementation that all exports have been declared.

Get the information needed to produce Cranelift IR for the given target.

Get the Cranelift reference type to use for the given Wasm reference type. Read more

Get the Cranelift integer type to use for native pointers. Read more

Get the size of a native pointer, in bytes.

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

Performs the conversion.

Performs the conversion.

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.