pub struct TableType { /* private fields */ }Expand description
A descriptor for a table in a WebAssembly module.
Tables are contiguous chunks of a specific element, typically a funcref or
an externref. The most common use for tables is a function table through
which call_indirect can invoke other functions.
Implementations§
Source§impl TableType
impl TableType
Sourcepub fn new(element: RefType, min: u32, max: Option<u32>) -> TableType
pub fn new(element: RefType, min: u32, max: Option<u32>) -> TableType
Creates a new table descriptor which will contain the specified
element and have the limits applied to its length.
Sourcepub fn new64(element: RefType, min: u64, max: Option<u64>) -> TableType
pub fn new64(element: RefType, min: u64, max: Option<u64>) -> TableType
Crates a new descriptor for a 64-bit table.
Note that 64-bit tables are part of the memory64 proposal for WebAssembly which is not standardized yet.
Sourcepub fn is_64(&self) -> bool
pub fn is_64(&self) -> bool
Returns whether or not this table is a 64-bit table.
Note that 64-bit tables are part of the memory64 proposal for WebAssembly which is not standardized yet.
Sourcepub fn maximum(&self) -> Option<u64>
pub fn maximum(&self) -> Option<u64>
Returns the optionally-specified maximum number of elements this table can have.
If this returns None then the table is not limited in size.
Sourcepub fn default_value(&self, store: impl AsContextMut) -> Result<Table, Error>
pub fn default_value(&self, store: impl AsContextMut) -> Result<Table, Error>
Construct a new table import whose entries are filled with this type’s default.
Creates a host Table in the store with its initial size and element
type’s default (e.g. null_ref for nullable refs).