Struct wasm_encoder::InstanceSection [−][src]
pub struct InstanceSection { /* fields omitted */ }
Expand description
An encoder for the instance section.
Note that this is part of the module linking proposal and is not currently part of stable WebAssembly.
Example
use wasm_encoder::{Module, InstanceSection, Export};
let mut instances = InstanceSection::new();
instances.instantiate(0, vec![
("x", Export::Function(0)),
("", Export::Module(2)),
("foo", Export::Global(0)),
]);
let mut module = Module::new();
module.section(&instances);
let wasm_bytes = module.finish();
Implementations
Construct a new instance section encoder.
pub fn instantiate<'a, I>(&mut self, module: u32, args: I) -> &mut Self where
I: IntoIterator<Item = (&'a str, Export)>,
I::IntoIter: ExactSizeIterator,
pub fn instantiate<'a, I>(&mut self, module: u32, args: I) -> &mut Self where
I: IntoIterator<Item = (&'a str, Export)>,
I::IntoIter: ExactSizeIterator,
Define an instantiation of the given module with the given items as arguments to the instantiation.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for InstanceSection
impl Send for InstanceSection
impl Sync for InstanceSection
impl Unpin for InstanceSection
impl UnwindSafe for InstanceSection
Blanket Implementations
Mutably borrows from an owned value. Read more