Skip to main content

ModuleInfo

Struct ModuleInfo 

Source
pub struct ModuleInfo<'src> {
    pub import_info: ImportInfo,
    pub wasm: InputModule<'src>,
    pub export_map: HashMap<(isize, usize), (Id<Export<'static>>, &'src str)>,
    pub symbols: SymbolMap<'src>,
    pub indirect_function_table_id: (Id<Table<'static>>, Id<Element<'static>>),
    pub indirect_function_list: Vec<Id<InputFunction<'static>>>,
}
Expand description

Provides a additional info about module. Like ordered_data_symbols - ordered by offsets where symbol is defined (relative to module start) and info about imported functions

Fields§

§import_info: ImportInfo§wasm: InputModule<'src>§export_map: HashMap<(isize, usize), (Id<Export<'static>>, &'src str)>§symbols: SymbolMap<'src>§indirect_function_table_id: (Id<Table<'static>>, Id<Element<'static>>)§indirect_function_list: Vec<Id<InputFunction<'static>>>

Implementations§

Source§

impl<'src> ModuleInfo<'src>

Source

pub fn from_wasm_bytes(wasm_bytes: &'src [u8]) -> Result<Self>

Source

pub fn from_raw_module(module: InputModule<'src>) -> Result<Self>

Source

pub fn function_id_iter<'any>( &'any self, ) -> impl Iterator<Item = Id<InputFunction<'static>>> + use<'any, 'src>

Source

pub fn is_imported_function(&self, func_id: Id<InputFunction<'static>>) -> bool

Source

pub fn as_defined_function_id( &self, func_id: Id<InputFunction<'static>>, ) -> Option<Id<FunctionWithBody<'static>>>

Source

pub fn get_function_type_id( &self, func_id: Id<InputFunction<'static>>, ) -> Id<FuncType>

Source

pub fn get_function_import_id( &self, func_id: Id<InputFunction<'static>>, ) -> Option<Id<Import<'static>>>

Source

pub fn get_global_import_id( &self, global_id: Id<Global<'static>>, ) -> Option<Id<Import<'static>>>

Source

pub fn find_function_id_by_name( &self, name: &str, ) -> Option<Id<InputFunction<'static>>>

Source

pub fn find_global_id_by_name(&self, name: &str) -> Option<Id<Global<'static>>>

Source

pub fn find_function_id_containing_range( &self, range: Range<usize>, ) -> Result<Id<InputFunction<'static>>>

Trait Implementations§

Source§

impl<'src> Debug for ModuleInfo<'src>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'src> Freeze for ModuleInfo<'src>

§

impl<'src> RefUnwindSafe for ModuleInfo<'src>

§

impl<'src> Send for ModuleInfo<'src>

§

impl<'src> Sync for ModuleInfo<'src>

§

impl<'src> Unpin for ModuleInfo<'src>

§

impl<'src> UnsafeUnpin for ModuleInfo<'src>

§

impl<'src> UnwindSafe for ModuleInfo<'src>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.