Struct wasmer_vm::ModuleInfo [−][src]
pub struct ModuleInfo {}Show fields
pub id: ModuleId, pub name: Option<String>, pub imports: IndexMap<(String, String, u32), ImportIndex>, pub exports: IndexMap<String, ExportIndex>, pub start_function: Option<FunctionIndex>, pub table_initializers: Vec<TableInitializer>, pub passive_elements: HashMap<ElemIndex, Box<[FunctionIndex]>>, pub passive_data: HashMap<DataIndex, Arc<[u8]>>, pub global_initializers: PrimaryMap<LocalGlobalIndex, GlobalInit>, pub function_names: HashMap<FunctionIndex, String>, pub signatures: PrimaryMap<SignatureIndex, FunctionType>, pub functions: PrimaryMap<FunctionIndex, SignatureIndex>, pub tables: PrimaryMap<TableIndex, TableType>, pub memories: PrimaryMap<MemoryIndex, MemoryType>, pub globals: PrimaryMap<GlobalIndex, GlobalType>, pub custom_sections: IndexMap<String, CustomSectionIndex>, pub custom_sections_data: PrimaryMap<CustomSectionIndex, Arc<[u8]>>, pub num_imported_functions: usize, pub num_imported_tables: usize, pub num_imported_memories: usize, pub num_imported_globals: usize,
Expand description
A translated WebAssembly module, excluding the function bodies and memory initializers.
Fields
id: ModuleId
A unique identifier (within this process) for this module.
We skip serialization/deserialization of this field, as it should be computed by the process. It’s not skipped in rkyv, but that is okay, because even though it’s skipped in bincode/serde it’s still deserialized back as a garbage number, and later override from computed by the process
name: Option<String>
The name of this wasm module, often found in the wasm file.
imports: IndexMap<(String, String, u32), ImportIndex>
Imported entities with the (module, field, index_of_the_import)
Keeping the index_of_the_import
is important, as there can be
two same references to the same import, and we don’t want to confuse
them.
exports: IndexMap<String, ExportIndex>
Exported entities.
start_function: Option<FunctionIndex>
The module “start” function, if present.
table_initializers: Vec<TableInitializer>
WebAssembly table initializers.
passive_elements: HashMap<ElemIndex, Box<[FunctionIndex]>>
WebAssembly passive elements.
passive_data: HashMap<DataIndex, Arc<[u8]>>
WebAssembly passive data segments.
global_initializers: PrimaryMap<LocalGlobalIndex, GlobalInit>
WebAssembly global initializers.
function_names: HashMap<FunctionIndex, String>
WebAssembly function names.
signatures: PrimaryMap<SignatureIndex, FunctionType>
WebAssembly function signatures.
functions: PrimaryMap<FunctionIndex, SignatureIndex>
WebAssembly functions (imported and local).
tables: PrimaryMap<TableIndex, TableType>
WebAssembly tables (imported and local).
memories: PrimaryMap<MemoryIndex, MemoryType>
WebAssembly linear memories (imported and local).
globals: PrimaryMap<GlobalIndex, GlobalType>
WebAssembly global variables (imported and local).
custom_sections: IndexMap<String, CustomSectionIndex>
Custom sections in the module.
custom_sections_data: PrimaryMap<CustomSectionIndex, Arc<[u8]>>
The data for each CustomSection in the module.
num_imported_functions: usize
Number of imported functions in the module.
num_imported_tables: usize
Number of imported tables in the module.
num_imported_memories: usize
Number of imported memories in the module.
num_imported_globals: usize
Number of imported globals in the module.
Implementations
impl ModuleInfo
[src]
impl ModuleInfo
[src]pub fn get_passive_element(&self, index: ElemIndex) -> Option<&[FunctionIndex]>
[src]
pub fn get_passive_element(&self, index: ElemIndex) -> Option<&[FunctionIndex]>
[src]Get the given passive element, if it exists.
pub fn exported_signatures(&self) -> Vec<FunctionType>
[src]
pub fn exported_signatures(&self) -> Vec<FunctionType>
[src]Get the exported signatures of the module
pub fn exports<'a>(
&'a self
) -> ExportsIterator<impl Iterator<Item = ExportType> + 'a>ⓘNotable traits for ExportsIterator<I>
impl<I: Iterator<Item = ExportType> + Sized> Iterator for ExportsIterator<I> type Item = ExportType;
[src]
pub fn exports<'a>(
&'a self
) -> ExportsIterator<impl Iterator<Item = ExportType> + 'a>ⓘNotable traits for ExportsIterator<I>
impl<I: Iterator<Item = ExportType> + Sized> Iterator for ExportsIterator<I> type Item = ExportType;
[src]Get the export types of the module
pub fn imports<'a>(
&'a self
) -> ImportsIterator<impl Iterator<Item = ImportType> + 'a>ⓘNotable traits for ImportsIterator<I>
impl<I: Iterator<Item = ImportType> + Sized> Iterator for ImportsIterator<I> type Item = ImportType;
[src]
pub fn imports<'a>(
&'a self
) -> ImportsIterator<impl Iterator<Item = ImportType> + 'a>ⓘNotable traits for ImportsIterator<I>
impl<I: Iterator<Item = ImportType> + Sized> Iterator for ImportsIterator<I> type Item = ImportType;
[src]Get the export types of the module
pub fn custom_sections<'a>(
&'a self,
name: &'a str
) -> impl Iterator<Item = Arc<[u8]>> + 'a
[src]
pub fn custom_sections<'a>(
&'a self,
name: &'a str
) -> impl Iterator<Item = Arc<[u8]>> + 'a
[src]Get the custom sections of the module given a name
.
pub fn func_index(&self, local_func: LocalFunctionIndex) -> FunctionIndex
[src]
pub fn func_index(&self, local_func: LocalFunctionIndex) -> FunctionIndex
[src]Convert a LocalFunctionIndex
into a FunctionIndex
.
pub fn local_func_index(
&self,
func: FunctionIndex
) -> Option<LocalFunctionIndex>
[src]
pub fn local_func_index(
&self,
func: FunctionIndex
) -> Option<LocalFunctionIndex>
[src]Convert a FunctionIndex
into a LocalFunctionIndex
. Returns None if the
index is an imported function.
pub fn is_imported_function(&self, index: FunctionIndex) -> bool
[src]
pub fn is_imported_function(&self, index: FunctionIndex) -> bool
[src]Test whether the given function index is for an imported function.
pub fn table_index(&self, local_table: LocalTableIndex) -> TableIndex
[src]
pub fn table_index(&self, local_table: LocalTableIndex) -> TableIndex
[src]Convert a LocalTableIndex
into a TableIndex
.
pub fn local_table_index(&self, table: TableIndex) -> Option<LocalTableIndex>
[src]
pub fn local_table_index(&self, table: TableIndex) -> Option<LocalTableIndex>
[src]Convert a TableIndex
into a LocalTableIndex
. Returns None if the
index is an imported table.
pub fn is_imported_table(&self, index: TableIndex) -> bool
[src]
pub fn is_imported_table(&self, index: TableIndex) -> bool
[src]Test whether the given table index is for an imported table.
pub fn memory_index(&self, local_memory: LocalMemoryIndex) -> MemoryIndex
[src]
pub fn memory_index(&self, local_memory: LocalMemoryIndex) -> MemoryIndex
[src]Convert a LocalMemoryIndex
into a MemoryIndex
.
pub fn local_memory_index(
&self,
memory: MemoryIndex
) -> Option<LocalMemoryIndex>
[src]
pub fn local_memory_index(
&self,
memory: MemoryIndex
) -> Option<LocalMemoryIndex>
[src]Convert a MemoryIndex
into a LocalMemoryIndex
. Returns None if the
index is an imported memory.
pub fn is_imported_memory(&self, index: MemoryIndex) -> bool
[src]
pub fn is_imported_memory(&self, index: MemoryIndex) -> bool
[src]Test whether the given memory index is for an imported memory.
pub fn global_index(&self, local_global: LocalGlobalIndex) -> GlobalIndex
[src]
pub fn global_index(&self, local_global: LocalGlobalIndex) -> GlobalIndex
[src]Convert a LocalGlobalIndex
into a GlobalIndex
.
pub fn local_global_index(
&self,
global: GlobalIndex
) -> Option<LocalGlobalIndex>
[src]
pub fn local_global_index(
&self,
global: GlobalIndex
) -> Option<LocalGlobalIndex>
[src]Convert a GlobalIndex
into a LocalGlobalIndex
. Returns None if the
index is an imported global.
pub fn is_imported_global(&self, index: GlobalIndex) -> bool
[src]
pub fn is_imported_global(&self, index: GlobalIndex) -> bool
[src]Test whether the given global index is for an imported global.
pub fn imported_function_types<'a>(
&'a self
) -> impl Iterator<Item = FunctionType> + 'a
[src]
pub fn imported_function_types<'a>(
&'a self
) -> impl Iterator<Item = FunctionType> + 'a
[src]Get the imported function types of the module.
Trait Implementations
impl Clone for ModuleInfo
[src]
impl Clone for ModuleInfo
[src]fn clone(&self) -> ModuleInfo
[src]
fn clone(&self) -> ModuleInfo
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for ModuleInfo
[src]
impl Debug for ModuleInfo
[src]impl<'de> Deserialize<'de> for ModuleInfo
[src]
impl<'de> Deserialize<'de> for ModuleInfo
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl Display for ModuleInfo
[src]
impl Display for ModuleInfo
[src]impl MemoryUsage for ModuleInfo
[src]
impl MemoryUsage for ModuleInfo
[src]fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize
[src]
fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize
[src]Returns the size of the referenced value in bytes. Read more
impl PartialEq<ModuleInfo> for ModuleInfo
[src]
impl PartialEq<ModuleInfo> for ModuleInfo
[src]impl Serialize for ModuleInfo
[src]
impl Serialize for ModuleInfo
[src]impl Eq for ModuleInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for ModuleInfo
impl Send for ModuleInfo
impl Sync for ModuleInfo
impl Unpin for ModuleInfo
impl UnwindSafe for ModuleInfo
Blanket Implementations
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,