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§

Creates a new wasm table instance with the given type.

Argument
  • ty - The type of the table instance to be created.
Error
  • If fail to create the table instance, then WasmEdgeError::Table(TableError::Create)(crate::error::TableError) is returned.

Returns the exported name of this table instance.

Notice that this field is meaningful only if this table is used as an exported instance.

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.

Returns a reference to the type of this table.

Returns the size of this Table.

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.

Returns the table element at the index.

Argument
  • index - the index of the table element to get.
Error

If fail to get the table element, then an error is returned.

Stores the data at the index of this table.

Arguments
  • index - the index of the table element to store.

  • data - the data to store at the index of this table.

Error

If fail to store the data, then an error is returned.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.