11use crate :: component:: func:: { bad_type_info, desc, LiftContext , LowerContext } ;
22use crate :: component:: instance:: RuntimeImport ;
3- use crate :: component:: linker:: ResourceImportIndex ;
43use crate :: component:: matching:: InstanceType ;
54use crate :: component:: { ComponentType , InstancePre , Lift , Lower } ;
65use crate :: store:: { StoreId , StoreOpaque } ;
@@ -11,7 +10,9 @@ use std::fmt;
1110use std:: marker;
1211use std:: mem:: MaybeUninit ;
1312use std:: sync:: atomic:: { AtomicU32 , Ordering :: Relaxed } ;
14- use wasmtime_environ:: component:: { CanonicalAbiInfo , DefinedResourceIndex , InterfaceType } ;
13+ use wasmtime_environ:: component:: {
14+ CanonicalAbiInfo , DefinedResourceIndex , InterfaceType , RuntimeImportIndex ,
15+ } ;
1516use wasmtime_runtime:: component:: { ComponentInstance , InstanceFlags , ResourceTables } ;
1617use wasmtime_runtime:: { SendSyncPtr , VMFuncRef , ValRaw } ;
1718
@@ -402,7 +403,7 @@ where
402403 self ,
403404 store : impl AsContextMut ,
404405 instance : & InstancePre < U > ,
405- idx : ResourceImportIndex ,
406+ idx : RuntimeImportIndex ,
406407 ) -> Result < ResourceAny > {
407408 ResourceAny :: try_from_resource ( self , store, instance, idx)
408409 }
@@ -516,16 +517,16 @@ struct OwnState {
516517
517518impl ResourceAny {
518519 /// Attempts to convert an imported [`Resource`] into [`ResourceAny`].
519- /// `idx` is the [`ResourceImportIndex `] returned by [`Linker:: resource`] .
520+ /// `idx` is the [`RuntimeImportIndex `] associated with this resource.
520521 pub fn try_from_resource < T : ' static , U > (
521522 Resource { rep, state, .. } : Resource < T > ,
522523 mut store : impl AsContextMut ,
523524 instance_pre : & InstancePre < U > ,
524- idx : ResourceImportIndex ,
525+ idx : RuntimeImportIndex ,
525526 ) -> Result < Self > {
526527 let store = store. as_context_mut ( ) ;
527528 let import = instance_pre
528- . resource_import ( idx)
529+ . runtime_import ( idx)
529530 . context ( "import not found" ) ?;
530531 let RuntimeImport :: Resource {
531532 ty, dtor_funcref, ..
0 commit comments