[][src]Struct wasmtime_environ::Module

pub struct Module {
    pub id: usize,
    pub name: Option<String>,
    pub local: ModuleLocal,
    pub imported_funcs: PrimaryMap<FuncIndex, (String, String, u32)>,
    pub imported_tables: PrimaryMap<TableIndex, (String, String, u32)>,
    pub imported_memories: PrimaryMap<MemoryIndex, (String, String, u32)>,
    pub imported_globals: PrimaryMap<GlobalIndex, (String, String, u32)>,
    pub exports: IndexMap<String, Export>,
    pub start_func: Option<FuncIndex>,
    pub table_elements: Vec<TableElements>,
    pub passive_elements: HashMap<ElemIndex, Box<[FuncIndex]>>,
    pub passive_data: HashMap<DataIndex, Arc<[u8]>>,
    pub func_names: HashMap<FuncIndex, String>,
}

A translated WebAssembly module, excluding the function bodies and memory initializers.

Fields

id: usize

A unique identifier (within this process) for this module.

name: Option<String>

The name of this wasm module, often found in the wasm file.

local: ModuleLocal

Local information about a module which is the bare minimum necessary to translate a function body. This is derived as Hash whereas this module isn't, since it contains too much information needed to translate a function.

imported_funcs: PrimaryMap<FuncIndex, (String, String, u32)>

Names of imported functions, as well as the index of the import that performed this import.

imported_tables: PrimaryMap<TableIndex, (String, String, u32)>

Names of imported tables.

imported_memories: PrimaryMap<MemoryIndex, (String, String, u32)>

Names of imported memories.

imported_globals: PrimaryMap<GlobalIndex, (String, String, u32)>

Names of imported globals.

exports: IndexMap<String, Export>

Exported entities.

start_func: Option<FuncIndex>

The module "start" function, if present.

table_elements: Vec<TableElements>

WebAssembly table initializers.

passive_elements: HashMap<ElemIndex, Box<[FuncIndex]>>

WebAssembly passive elements.

passive_data: HashMap<DataIndex, Arc<[u8]>>

WebAssembly passive data segments.

func_names: HashMap<FuncIndex, String>

WebAssembly table initializers.

Methods

impl Module[src]

pub fn new() -> Self[src]

Allocates the module data structures.

pub fn get_passive_element(&self, index: ElemIndex) -> Option<&[FuncIndex]>[src]

Get the given passive element, if it exists.

Trait Implementations

impl Debug for Module[src]

Auto Trait Implementations

impl RefUnwindSafe for Module

impl Send for Module

impl Sync for Module

impl Unpin for Module

impl UnwindSafe for Module

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.