[−][src]Struct wasm_encoder::GlobalSection
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
impl GlobalSection
[src]
pub fn new() -> GlobalSection
[src]
Create a new global section encoder.
pub fn global(
&mut self,
global_type: GlobalType,
init_expr: Instruction<'_>
) -> &mut Self
[src]
&mut self,
global_type: GlobalType,
init_expr: Instruction<'_>
) -> &mut Self
Define a global.
Trait Implementations
impl Section for GlobalSection
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,