(
component: &'a Component,
store: &mut StoreOpaque,
imports: &'a Arc<PrimaryMap<RuntimeImportIndex, RuntimeImport>>,
)
| 685 | |
| 686 | impl<'a> Instantiator<'a> { |
| 687 | fn new( |
| 688 | component: &'a Component, |
| 689 | store: &mut StoreOpaque, |
| 690 | imports: &'a Arc<PrimaryMap<RuntimeImportIndex, RuntimeImport>>, |
| 691 | ) -> Result<Instantiator<'a>> { |
| 692 | let env_component = component.env_component(); |
| 693 | let (modules, engine, breakpoints) = store.modules_and_engine_and_breakpoints_mut(); |
| 694 | modules.register_component(component, engine, breakpoints)?; |
| 695 | let imported_resources: ImportedResources = |
| 696 | TryPrimaryMap::with_capacity(env_component.imported_resources.len())?; |
| 697 | |
| 698 | let instance = ComponentInstance::new( |
| 699 | store.store_data().components.next_component_instance_id(), |
| 700 | component, |
| 701 | try_new::<Arc<_>>(imported_resources)?, |
| 702 | imports, |
| 703 | store.traitobj(), |
| 704 | )?; |
| 705 | let id = store.store_data_mut().push_component_instance(instance)?; |
| 706 | |
| 707 | Ok(Instantiator { |
| 708 | component, |
| 709 | imports, |
| 710 | core_imports: OwnedImports::empty(), |
| 711 | id, |
| 712 | }) |
| 713 | } |
| 714 | |
| 715 | async fn run<T>( |
| 716 | &mut self, |
nothing calls this directly
no test coverage detected