Struct walrus::ModuleTables
source · pub struct ModuleTables { /* private fields */ }
Expand description
The set of tables in this module.
Implementations§
source§impl ModuleTables
impl ModuleTables
sourcepub fn add_import(
&mut self,
initial: u32,
max: Option<u32>,
element_ty: ValType,
import: ImportId
) -> TableId
pub fn add_import( &mut self, initial: u32, max: Option<u32>, element_ty: ValType, import: ImportId ) -> TableId
Adds a new imported table to this list of tables
sourcepub fn add_local(
&mut self,
initial: u32,
max: Option<u32>,
element_ty: ValType
) -> TableId
pub fn add_local( &mut self, initial: u32, max: Option<u32>, element_ty: ValType ) -> TableId
Construct a new table, that does not originate from any of the input wasm tables.
sourcepub fn get_mut(&mut self, table: TableId) -> &mut Table
pub fn get_mut(&mut self, table: TableId) -> &mut Table
Returns the actual table associated with an ID
sourcepub fn delete(&mut self, id: TableId)
pub fn delete(&mut self, id: TableId)
Removes a table from this module.
It is up to you to ensure that any potential references to the deleted
table are also removed, eg call_indirect
expressions and exports, etc.
sourcepub fn main_function_table(&self) -> Result<Option<TableId>>
pub fn main_function_table(&self) -> Result<Option<TableId>>
Finds a unique function table in a module.
Modules produced by compilers like LLVM typically have one function
table for indirect function calls. This function will look for a single
function table inside this module, and return that if found. If no
function tables are present None
will be returned
Errors
Returns an error if there are two function tables in this module
Trait Implementations§
source§impl Debug for ModuleTables
impl Debug for ModuleTables
source§impl Default for ModuleTables
impl Default for ModuleTables
source§fn default() -> ModuleTables
fn default() -> ModuleTables
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ModuleTables
impl Send for ModuleTables
impl Sync for ModuleTables
impl Unpin for ModuleTables
impl UnwindSafe for ModuleTables
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