Struct wasmi::TableInstance
[−]
[src]
pub struct TableInstance { /* fields omitted */ }
Runtime representation of a table.
A table is a array of untyped functions. It allows wasm code to call functions indirectly through a dynamic index into a table. For example, this allows emulating function pointers by way of table indices.
Table is created with an initial size but can be grown dynamically via grow
method.
Growth can be limited by an optional maximum size.
In future, a table might be extended to be able to hold not only functions but different types.
Methods
impl TableInstance
[src]
fn alloc(
initial_size: u32,
maximum_size: Option<u32>
) -> Result<TableRef, Error>
[src]
initial_size: u32,
maximum_size: Option<u32>
) -> Result<TableRef, Error>
fn initial_size(&self) -> u32
[src]
fn maximum_size(&self) -> Option<u32>
[src]
fn current_size(&self) -> u32
[src]
fn grow(&self, by: u32) -> Result<(), Error>
[src]
fn get(&self, offset: u32) -> Result<FuncRef, Error>
[src]
Get the specific value in the table
fn set(&self, offset: u32, value: Option<FuncRef>) -> Result<(), Error>
[src]
Set the table element to the specified function.