Struct wasmtime_environ::ModuleEnvironment
source · pub struct ModuleEnvironment<'a, 'data> { /* private fields */ }
Expand description
Object containing the standalone environment information.
Implementations§
source§impl<'a, 'data> ModuleEnvironment<'a, 'data>
impl<'a, 'data> ModuleEnvironment<'a, 'data>
sourcepub fn new(
tunables: &'a Tunables,
validator: &'a mut Validator,
types: &'a mut ModuleTypesBuilder
) -> Self
pub fn new( tunables: &'a Tunables, validator: &'a mut Validator, types: &'a mut ModuleTypesBuilder ) -> Self
Allocates the environment data structures.
sourcepub fn translate(
self,
parser: Parser,
data: &'data [u8]
) -> WasmResult<ModuleTranslation<'data>>
pub fn translate( self, parser: Parser, data: &'data [u8] ) -> WasmResult<ModuleTranslation<'data>>
Translate a wasm module using this environment.
This function will translate the data
provided with parser
,
validating everything along the way with this environment’s validator.
The result of translation, ModuleTranslation
, contains everything
necessary to compile functions afterwards as well as learn type
information about the module at runtime.