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.
sourcepub fn get(&self, index: u32) -> WasmEdgeResult<Val>
pub fn get(&self, index: u32) -> WasmEdgeResult<Val>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl !UnwindSafe for Table
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