@@ -51,7 +51,7 @@ use crate::prelude::*;
5151use crate :: { EntityIndex , ModuleInternedTypeIndex , PrimaryMap , WasmValType } ;
5252use cranelift_entity:: packed_option:: PackedOption ;
5353use serde_derive:: { Deserialize , Serialize } ;
54- use std :: collections:: HashMap ;
54+ use wasmparser :: collections:: Map ;
5555
5656/// Metadata as a result of compiling a component.
5757pub struct ComponentTranslation {
@@ -66,26 +66,24 @@ pub struct ComponentTranslation {
6666/// The elements within [`Self::instances`] correspond to the runtime component
6767/// instances which directly instantiate core modules. Each element should contain the information
6868/// needed to identify the source of their imports. Specific information about how that is
69- /// implemented is available in [`dfg ::RuntimeComponentInstanceStructure`]
69+ /// implemented is available in [`info ::RuntimeComponentInstanceStructure`]
7070#[ derive( Serialize , Deserialize , Default , Clone , Debug ) ]
7171pub struct RootComponentInstanceStructure {
7272 /// Subcomponent instances that instantiate core modules directly. The keys are the [`RuntimeComponentInstanceStructure.path`]
73- pub instances : HashMap < String , RuntimeComponentInstanceStructure > ,
73+ pub instances : Map < String , RuntimeComponentInstanceStructure > ,
7474
7575 /// Re-mapping table from the [`RuntimeComponentInstanceIndex`] to [`RuntimeComponentInstanceStructure.path`]
76- pub table : HashMap < u32 , String > ,
76+ pub table : Map < u32 , String > ,
7777}
7878
7979impl RootComponentInstanceStructure {
8080 /// todo:
81- pub fn runtime_instances_mut (
82- & mut self ,
83- ) -> & mut HashMap < String , RuntimeComponentInstanceStructure > {
81+ pub fn runtime_instances_mut ( & mut self ) -> & mut Map < String , RuntimeComponentInstanceStructure > {
8482 & mut self . instances
8583 }
8684
8785 /// todo:
88- pub fn table_mut ( & mut self ) -> & mut HashMap < u32 , String > {
86+ pub fn table_mut ( & mut self ) -> & mut Map < u32 , String > {
8987 & mut self . table
9088 }
9189}
@@ -96,11 +94,11 @@ pub struct CoreInstanceStructure {
9694 /// Hex encoded sha256 digest of the core module binary.
9795 pub module_code_digest : String ,
9896 /// Exported items from this core instance
99- pub core_exports : HashMap < u32 , String > ,
97+ pub core_exports : Map < u32 , String > ,
10098 /// Imported items by this core instance
101- pub core_imports : HashMap < u32 , String > ,
99+ pub core_imports : Map < u32 , String > ,
102100 /// The sources of the imported items
103- pub sources : HashMap < u32 , Source > ,
101+ pub sources : Map < u32 , Source > ,
104102}
105103
106104/// Represents a core export definition in the instantiation graph, used to track the source of
@@ -141,11 +139,11 @@ pub struct RuntimeComponentInstanceStructure {
141139 pub path : String ,
142140
143141 /// Maps to the core definitions that are being exported by this component.
144- pub component_exports : HashMap < u32 , Source > ,
142+ pub component_exports : Map < u32 , Source > ,
145143
146144 /// Map of the core instances associated with this component instance.
147145 /// The index represents the core instance index within the index space of this component.
148- pub core_instances : HashMap < u32 , CoreInstanceStructure > ,
146+ pub core_instances : Map < u32 , CoreInstanceStructure > ,
149147}
150148
151149/// Run-time-type-information about a `Component`, its structure, and how to
0 commit comments