Struct wasm_encoder::TableSection
source · pub struct TableSection { /* private fields */ }
Expand description
An encoder for the table section.
Table sections are only supported for modules.
Example
use wasm_encoder::{Module, TableSection, TableType, RefType};
let mut tables = TableSection::new();
tables.table(TableType {
element_type: RefType::FUNCREF,
minimum: 128,
maximum: None,
});
let mut module = Module::new();
module.section(&tables);
let wasm_bytes = module.finish();
Implementations§
source§impl TableSection
impl TableSection
sourcepub fn table_with_init(
&mut self,
table_type: TableType,
init: &ConstExpr
) -> &mut Self
pub fn table_with_init( &mut self, table_type: TableType, init: &ConstExpr ) -> &mut Self
Define a table with an explicit initialization expression.
Note that this is part of the function-references proposal.
Trait Implementations§
source§impl Clone for TableSection
impl Clone for TableSection
source§fn clone(&self) -> TableSection
fn clone(&self) -> TableSection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TableSection
impl Debug for TableSection
source§impl Default for TableSection
impl Default for TableSection
source§fn default() -> TableSection
fn default() -> TableSection
Returns the “default value” for a type. Read more