Struct golem_wasm_ast::core::Elem
source · pub struct Elem<Expr> {
pub ref_type: RefType,
pub init: Vec<Expr>,
pub mode: ElemMode,
}
Expand description
The initial contents of a table is uninitialized. Element segments can be used to initialize a subrange of a table from a static vector of elements.
The elems component of a module defines a vector of element segments. Each element segment defines a reference type and a corresponding list of constant element expressions.
Element segments have a mode that identifies them as either passive, active, or declarative. A passive element segment’s elements can be copied to a table using the table.init instruction. An active element segment copies its elements into a table during instantiation, as specified by a table index and a constant expression defining an offset into that table. A declarative element segment is not available at runtime but merely serves to forward-declare references that are formed in code with instructions like ref.func.
Element segments are referenced through element indices.
Fields§
§ref_type: RefType
§init: Vec<Expr>
§mode: ElemMode
Trait Implementations§
source§impl<Expr: PartialEq> PartialEq for Elem<Expr>
impl<Expr: PartialEq> PartialEq for Elem<Expr>
source§impl<Expr: Debug + Clone + PartialEq> Section<CoreIndexSpace, CoreSectionType> for Elem<Expr>
impl<Expr: Debug + Clone + PartialEq> Section<CoreIndexSpace, CoreSectionType> for Elem<Expr>
fn index_space(&self) -> CoreIndexSpace
fn section_type(&self) -> CoreSectionType
source§impl<T: RetainsInstructions> TryFrom<&Elem<T>> for ElementSection
impl<T: RetainsInstructions> TryFrom<&Elem<T>> for ElementSection
impl<Expr> StructuralPartialEq for Elem<Expr>
Auto Trait Implementations§
impl<Expr> Freeze for Elem<Expr>
impl<Expr> RefUnwindSafe for Elem<Expr>where
Expr: RefUnwindSafe,
impl<Expr> Send for Elem<Expr>where
Expr: Send,
impl<Expr> Sync for Elem<Expr>where
Expr: Sync,
impl<Expr> Unpin for Elem<Expr>where
Expr: Unpin,
impl<Expr> UnwindSafe for Elem<Expr>where
Expr: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)