Struct wasm_encoder::GlobalSection [−][src]
pub struct GlobalSection { /* fields omitted */ }Expand description
An encoder for the global section.
Example
use wasm_encoder::{Module, GlobalSection, GlobalType, Instruction, ValType}; let mut globals = GlobalSection::new(); globals.global( GlobalType { val_type: ValType::I32, mutable: false, }, Instruction::I32Const(42), ); let mut module = Module::new(); module.section(&globals); let wasm_bytes = module.finish();
Implementations
Create a new global section encoder.
Define a global.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for GlobalSectionimpl Send for GlobalSectionimpl Sync for GlobalSectionimpl Unpin for GlobalSectionimpl UnwindSafe for GlobalSectionBlanket Implementations
Mutably borrows from an owned value. Read more