pub struct Sections {
types: TypeSection,
imports: ImportSection,
functions: FunctionSection,
memories: MemorySection,
exports: ExportSection,
data: DataSection,
function_names: NameMap,
memory_names: NameMap,
type_names: NameMap,
data_names: NameMap,
function_definitions: BTreeMap<u32, FunctionDefinition>,
}
Expand description
Contains the various sections of a WASM module being built. Declarations are added here, and definitions are stored for later assembly.
Fields§
§types: TypeSection
§imports: ImportSection
§functions: FunctionSection
§memories: MemorySection
§exports: ExportSection
§data: DataSection
§function_names: NameMap
§memory_names: NameMap
§type_names: NameMap
§data_names: NameMap
§function_definitions: BTreeMap<u32, FunctionDefinition>
Implementations§
Source§impl Sections
impl Sections
Sourcepub fn add_active_data_segment(&mut self, segment: ActiveDataSegment)
pub fn add_active_data_segment(&mut self, segment: ActiveDataSegment)
Adds an active data segment to the data section. These segments are copied into a linear memory at a specified offset during instantiation. Currently, all active data segments are hardcoded to target memory index 1 (state memory).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sections
impl RefUnwindSafe for Sections
impl Send for Sections
impl Sync for Sections
impl Unpin for Sections
impl UnwindSafe for Sections
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