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 GlobalSection
impl Send for GlobalSection
impl Sync for GlobalSection
impl Unpin for GlobalSection
impl UnwindSafe for GlobalSection
Blanket Implementations
Mutably borrows from an owned value. Read more