wasm_gen

Struct WasmCodeGen

source
pub struct WasmCodeGen { /* private fields */ }

Implementations§

source§

impl WasmCodeGen

source

pub fn new() -> WasmCodeGen

source

pub fn to_bytes(&self) -> Vec<u8>

source

pub fn set_name(&mut self, idx: usize, name: String)

source

pub fn add_type(&mut self, t: FuncType) -> usize

source

pub fn add_export(&mut self, name: String, idx: usize, export_type: ExportType)

source

pub fn add_func(&mut self, f: Func) -> usize

source

pub fn add_func_with_type(&mut self, f: Func, t: u32) -> usize

source

pub fn replace_code_func(&mut self, idx: usize, code: Vec<FuncCode>)

source

pub fn add_table( &mut self, elemtype: TableElemType, min: u32, max: u32, ) -> usize

source

pub fn add_element(&mut self, table: u32, offset: u32, funcs: Vec<u32>) -> usize

source

pub fn add_memory(&mut self, min: u32, max: u32) -> usize

source

pub fn add_data(&mut self, offset: u32, bytes: Vec<u8>) -> u32

source

pub fn add_import( &mut self, module: String, name: String, import_type: ImportType, typeidx: usize, ) -> usize

source

pub fn add_mutable_global(&mut self, valtype: u8, init: u32) -> usize

Auto Trait Implementations§

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 = 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 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.