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,
table64: false,
shared: false,
});
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
Source§impl Encode for TableSection
impl Encode for TableSection
Auto Trait Implementations§
impl Freeze for TableSection
impl RefUnwindSafe for TableSection
impl Send for TableSection
impl Sync for TableSection
impl Unpin for TableSection
impl UnwindSafe for TableSection
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)