Struct wasmedge_sdk::Table
source · pub struct Table { /* private fields */ }
Expand description
Defines a table storing the references to host functions or external objects.
Implementations§
source§impl Table
impl Table
sourcepub fn new(ty: TableType) -> WasmEdgeResult<Self>
pub fn new(ty: TableType) -> WasmEdgeResult<Self>
sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
Returns the exported name of this table instance.
Notice that this field is meaningful only if this table is used as an exported instance.
sourcepub fn mod_name(&self) -> Option<&str>
pub fn mod_name(&self) -> Option<&str>
Returns the name of the module instance from which this table instance exports.
Notice that this field is meaningful only if this table is used as an exported instance.
sourcepub fn grow(&mut self, delta: u32, init: Option<Val>) -> WasmEdgeResult<u32>
pub fn grow(&mut self, delta: u32, init: Option<Val>) -> WasmEdgeResult<u32>
Grows the size of this table by delta
, initializing the elements with the provided init value if init
is given. Returns the previous size of the table.
Arguments
-
delta
- The number of elements to grow the table instance by. -
init
- The value to initialize the new table slots with.
Error
If fail to grow the table, then an error is returned.