Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions crates/wasm-encoder/src/component/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,19 @@ impl ComponentBuilder {
base
}

/// Creates a new component instance from the `exports` provided.
///
/// Returns the index of the component instance created.
pub fn instantiate_exports<'a, E, N>(&mut self, debug_name: Option<&str>, exports: E) -> u32
where
E: IntoIterator<Item = (N, ComponentExportKind, u32)>,
E::IntoIter: ExactSizeIterator,
N: Into<ComponentExternName<'a>>,
{
self.component_instances().export_items(exports);
self.instances.add(debug_name)
}

/// Declares a new `resource.drop` intrinsic.
pub fn resource_drop(&mut self, ty: u32) -> u32 {
self.canonical_functions().resource_drop(ty);
Expand Down
Loading