pub struct ValidationInfo<'bytecode> {Show 14 fields
pub(crate) wasm: &'bytecode [u8],
pub(crate) types: IdxVec<TypeIdx, FuncType>,
pub(crate) imports: Vec<Import<'bytecode>>,
pub(crate) functions: ExtendedIdxVec<FuncIdx, TypeIdx>,
pub(crate) tables: ExtendedIdxVec<TableIdx, TableType>,
pub(crate) memories: ExtendedIdxVec<MemIdx, MemType>,
pub(crate) globals: ExtendedIdxVec<GlobalIdx, Global>,
pub(crate) exports: Vec<Export<'bytecode>>,
pub(crate) elements: IdxVec<ElemIdx, ElemType>,
pub(crate) data: IdxVec<DataIdx, DataSegment>,
pub(crate) func_blocks_stps: Vec<(Span, usize)>,
pub(crate) sidetable: Vec<SidetableEntry>,
pub(crate) start: Option<FuncIdx>,
pub(crate) custom_sections: Vec<CustomSection<'bytecode>>,
}Expand description
Information collected from validating a module.
This can be used to instantiate a new module instance in some
Store thorugh
Store::module_instantiate
Fields§
§wasm: &'bytecode [u8]§types: IdxVec<TypeIdx, FuncType>§imports: Vec<Import<'bytecode>>§functions: ExtendedIdxVec<FuncIdx, TypeIdx>§tables: ExtendedIdxVec<TableIdx, TableType>§memories: ExtendedIdxVec<MemIdx, MemType>§globals: ExtendedIdxVec<GlobalIdx, Global>§exports: Vec<Export<'bytecode>>§elements: IdxVec<ElemIdx, ElemType>§data: IdxVec<DataIdx, DataSegment>§func_blocks_stps: Vec<(Span, usize)>Each block contains the validated code section and the stp corresponding to the beginning of that code section
sidetable: Vec<SidetableEntry>§start: Option<FuncIdx>The start function which is automatically executed during instantiation
custom_sections: Vec<CustomSection<'bytecode>>Implementations§
Source§impl<'wasm> ValidationInfo<'wasm>
impl<'wasm> ValidationInfo<'wasm>
Sourcepub fn imports<'a>(
&'a self,
) -> Map<Iter<'a, Import<'wasm>>, impl FnMut(&'a Import<'wasm>) -> (&'a str, &'a str, ExternType)>
pub fn imports<'a>( &'a self, ) -> Map<Iter<'a, Import<'wasm>>, impl FnMut(&'a Import<'wasm>) -> (&'a str, &'a str, ExternType)>
Returns the imports of this module as an iterator. Each import consist of a module name, a name and an extern type.
See: WebAssembly Specification 2.0 - 7.1.5 - module_imports
Sourcepub fn exports<'a>(
&'a self,
) -> Map<Iter<'a, Export<'wasm>>, impl FnMut(&'a Export<'wasm>) -> (&'a str, ExternType)>
pub fn exports<'a>( &'a self, ) -> Map<Iter<'a, Export<'wasm>>, impl FnMut(&'a Export<'wasm>) -> (&'a str, ExternType)>
Returns the exports of this module as an iterator. Each export consist of a name, and an extern type.
See: WebAssembly Specification 2.0 - 7.1.5 - module_exports
Sourcepub fn custom_sections(&self) -> &[CustomSection<'wasm>]
pub fn custom_sections(&self) -> &[CustomSection<'wasm>]
Returns a list of all custom sections in the bytecode. Every custom section consists of its name and the custom section’s bytecode (excluding the name itself).
Trait Implementations§
Source§impl<'bytecode> Clone for ValidationInfo<'bytecode>
impl<'bytecode> Clone for ValidationInfo<'bytecode>
Source§fn clone(&self) -> ValidationInfo<'bytecode>
fn clone(&self) -> ValidationInfo<'bytecode>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more