pub fn new(module: &impl ModuleAccess) -> Self {
        let mut address_map = BTreeMap::new();
        for (idx, address) in module.address_identifiers().iter().enumerate() {
            address_map.insert(address.clone(), AddressIdentifierIndex(idx as u16));
        }
        let mut identifier_map = BTreeMap::new();
        for (idx, name) in module.identifiers().iter().enumerate() {
            identifier_map.insert(name.clone(), IdentifierIndex(idx as u16));
        }
        let mut module_handle_map = BTreeMap::new();
        for (idx, module_hadndle) in module.module_handles().iter().enumerate() {
            module_handle_map.insert(module_hadndle.clone(), ModuleHandleIndex(idx as u16));
        }
        let mut struct_handle_map = BTreeMap::new();
        for (idx, struct_handle) in module.struct_handles().iter().enumerate() {
            struct_handle_map.insert(struct_handle.clone(), StructHandleIndex(idx as u16));
        }
        Self {
            address_map,
            identifier_map,
            module_handle_map,
            struct_handle_map,
        }
    }
/// create a new instance of Resolver for module
create a new instance of Resolver for module
create a new instance of Resolver for module
pub fn new(module: &impl ModuleAccess) -> Self {
        let mut address_map = BTreeMap::new();
        for (idx, address) in module.address_identifiers().iter().enumerate() {
            address_map.insert(address.clone(), AddressIdentifierIndex(idx as u16));
        }
        let mut identifier_map = BTreeMap::new();
        for (idx, name) in module.identifiers().iter().enumerate() {
            identifier_map.insert(name.clone(), IdentifierIndex(idx as u16));
        }
        let mut module_handle_map = BTreeMap::new();
        for (idx, module_hadndle) in module.module_handles().iter().enumerate() {
            module_handle_map.insert(module_hadndle.clone(), ModuleHandleIndex(idx as u16));
        }
        let mut struct_handle_map = BTreeMap::new();
        for (idx, struct_handle) in module.struct_handles().iter().enumerate() {
            struct_handle_map.insert(struct_handle.clone(), StructHandleIndex(idx as u16));
        }
        Self {
            address_map,
            identifier_map,
            module_handle_map,
            struct_handle_map,
        }
    }
pub fn new ( module : & impl ModuleAccess ) -> Self { let mut address_map = BTreeMap :: new ( ) ; for ( idx , address ) in module . address_identifiers ( ) . iter ( ) . enumerate ( ) { address_map . insert ( address . clone ( ) , AddressIdentifierIndex ( idx as u16 ) ) ; } let mut identifier_map = BTreeMap :: new ( ) ; for ( idx , name ) in module . identifiers ( ) . iter ( ) . enumerate ( ) { identifier_map . insert ( name . clone ( ) , IdentifierIndex ( idx as u16 ) ) ; } let mut module_handle_map = BTreeMap :: new ( ) ; for ( idx , module_hadndle ) in module . module_handles ( ) . iter ( ) . enumerate ( ) { module_handle_map . insert ( module_hadndle . clone ( ) , ModuleHandleIndex ( idx as u16 ) ) ; } let mut struct_handle_map = BTreeMap :: new ( ) ; for ( idx , struct_handle ) in module . struct_handles ( ) . iter ( ) . enumerate ( ) { struct_handle_map . insert ( struct_handle . clone ( ) , StructHandleIndex ( idx as u16 ) ) ; } Self { address_map , identifier_map , module_handle_map , struct_handle_map , } }
create a new instance of Resolver for module
create a new instance of Resolver for module
module
&impl ModuleAccess
module
&impl ModuleAccess