pub struct ValidationInfo<'bytecode> {Show 13 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>,
}Expand description
Information collected from validating a module.
This can be used to instantiate a new module instance in some
Store either through
Store::module_instantiate_unchecked
or
Linker::module_instantiate_unchecked.
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
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
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>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'bytecode> Freeze for ValidationInfo<'bytecode>
impl<'bytecode> RefUnwindSafe for ValidationInfo<'bytecode>
impl<'bytecode> Send for ValidationInfo<'bytecode>
impl<'bytecode> Sync for ValidationInfo<'bytecode>
impl<'bytecode> Unpin for ValidationInfo<'bytecode>
impl<'bytecode> UnwindSafe for ValidationInfo<'bytecode>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more