pub struct WasmModule {
    pub inner: Arc<Module>,
    pub func_names: Mutex<HashMap<u32, String>>,
    /* private fields */
}

Fields§

§inner: Arc<Module>§func_names: Mutex<HashMap<u32, String>>

Implementations§

source§

impl WasmModule

source

pub fn new(inner: Arc<Module>) -> Self

source

pub fn add_func_name(&self, funcidx: u32, name: &str)

source

pub fn get_coredump(&self) -> Result<Coredump, Box<dyn Error>>

source

pub fn add_data(&self, offset: u32, bytes: &[u8]) -> (u32, u32)

source

pub fn is_func_imported(&self, funcidx: u32) -> bool

source

pub fn imports(&self) -> &Vec<Import>

source

pub fn globals(&self) -> &Vec<Global>

source

pub fn func_locals_count(&self, funcidx: u32) -> u32

source

pub fn func_locals(&self, funcidx: u32) -> Vec<CodeLocal>

source

pub fn is_func_exported(&self, funcidx: u32) -> bool

source

pub fn get_export_func( &self, name: &str ) -> Result<(&Code, Type), Box<dyn Error>>

source

pub fn get_func_type(&self, funcidx: u32) -> Type

Retrieve the type of a function, note that this doesn’t work for imported functions as they have their type expressed differently.

source

pub fn add_func_local(&self, target_funcidx: u32, local: CodeLocal) -> bool

source

pub fn get_type(&self, typeidx: u32) -> Option<Type>

source

pub fn get_func_typeidx(&self, funcidx: u32) -> u32

source

pub fn get_code_section_start_offset(&self) -> Option<usize>

source

pub fn get_start_of_func(&self, funcidx: u32) -> Option<usize>

source

pub fn get_custom_section(&self, name: &str) -> Option<Vec<u8>>

source

pub fn get_func_name(&self, funcidx: u32) -> Option<String>

source

pub fn find_import(&self, name: &str) -> u32

source

pub fn add_import(&self, _import: &Import) -> u32

source

pub fn add_global(&self, global: &Global) -> Option<u32>

source

pub fn add_function(&self, func: &Code, typeidx: u32) -> u32

source

pub fn add_type(&self, t: &Type) -> u32

source

pub fn add_section(&self, s: Section)

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.