pub struct ObjectBuilder<'a> { /* private fields */ }
Expand description

Helper structure to create an ELF file as a compilation artifact.

This structure exposes the process which Wasmtime will encode a core wasm module into an ELF file, notably managing data sections and all that good business going into the final file.

Implementations§

Creates a new builder for the obj specified.

Completes compilation of the translation specified, inserting everything necessary into the Object being built.

This function will consume the final results of compiling a wasm module and finish the ELF image in-progress as part of self.obj by appending any compiler-agnostic sections.

The auxiliary CompiledModuleInfo structure returned here has also been serialized into the object returned, but if the caller will quickly turn-around and invoke CompiledModule::from_artifacts after this then the information can be passed to that method to avoid extra deserialization. This is done to avoid a serialize-then-deserialize for API calls like Module::new where the compiled module is immediately going to be used.

The various arguments here are:

  • translation - the core wasm translation that’s being completed.

  • funcs - compilation metadata about functions within the translation as well as where the functions are located in the text section.

  • trampolines - list of all trampolines necessary for this module and where they’re located in the text section.

Returns the CompiledModuleInfo corresopnding to this core wasm module as a result of this append operation. This is then serialized into the final artifact by the caller.

Creates the ELF_WASMTIME_INFO section from the given serializable data structure.

Creates a new MmapVec from self.

The returned MmapVec will contain the serialized version of self and is sized appropriately to the exact size of the object serialized.

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.