pub fn resolve_function_ref_with_fetcher<F>(
        &self,
        caller_module: &LoadedModule,
        idx: FunctionHandleIndex,
        fetcher: &F,
    ) -> VMResult<Option<FunctionRef<'alloc>>>
    where
        F: ModuleFetcher,
    {
        let function_handle = caller_module.function_handle_at(idx);
        let callee_name = caller_module.identifier_at(function_handle.name);
        let callee_module_id = FunctionHandleView::new(caller_module, function_handle).module_id();

        match self.get_loaded_module_with_fetcher(&callee_module_id, fetcher) {
            Ok(Some(callee_module)) => {
                let callee_func_id = callee_module
                    .function_defs_table
                    .get(callee_name)
                    .ok_or_else(|| VMStatus::new(StatusCode::LINKER_ERROR))?;
                Ok(Some(FunctionRef::new(callee_module, *callee_func_id)))
            }
            Ok(None) => Ok(None),
            Err(errors) => Err(errors),
        }
    }
/// Resolve a FunctionHandleIndex into a FunctionRef in either the cache or the `fetcher`.
/// An Ok(None) will be returned if no such function is found.
Resolve a FunctionHandleIndex into a FunctionRef in either the cache or the `fetcher`.
An Ok(None) will be returned if no such function is found.
Resolve a FunctionHandleIndex into a FunctionRef in either the cache or the ` fetcher ` . An Ok ( None ) will be returned if no such function is found .
pub fn resolve_function_ref_with_fetcher<F>(
        &self,
        caller_module: &LoadedModule,
        idx: FunctionHandleIndex,
        fetcher: &F,
    ) -> VMResult<Option<FunctionRef<'alloc>>>
    where
        F: ModuleFetcher,
    {
        let function_handle = caller_module.function_handle_at(idx);
        let callee_name = caller_module.identifier_at(function_handle.name);
        let callee_module_id = FunctionHandleView::new(caller_module, function_handle).module_id();
        match self.get_loaded_module_with_fetcher(&callee_module_id, fetcher) {
            Ok(Some(callee_module)) => {
                let callee_func_id = callee_module
                    .function_defs_table
                    .get(callee_name)
                    .ok_or_else(|| VMStatus::new(StatusCode::LINKER_ERROR))?;
                Ok(Some(FunctionRef::new(callee_module, *callee_func_id)))
            }
            Ok(None) => Ok(None),
            Err(errors) => Err(errors),
        }
    }
pub fn resolve_function_ref_with_fetcher < F > ( & self , caller_module : & LoadedModule , idx : FunctionHandleIndex , fetcher : & F , ) -> VMResult < Option < FunctionRef < ' alloc > > > where F : ModuleFetcher , { let function_handle = caller_module . function_handle_at ( idx ) ; let callee_name = caller_module . identifier_at ( function_handle . name ) ; let callee_module_id = FunctionHandleView :: new ( caller_module , function_handle ) . module_id ( ) ; match self . get_loaded_module_with_fetcher ( & callee_module_id , fetcher ) { Ok ( Some ( callee_module ) ) => { let callee_func_id = callee_module . function_defs_table . get ( callee_name ) . ok_or_else ( | | VMStatus :: new ( StatusCode :: LINKER_ERROR ) ) ? ; Ok ( Some ( FunctionRef :: new ( callee_module , * callee_func_id ) ) ) } Ok ( None ) => Ok ( None ) , Err ( errors ) => Err ( errors ) , } }
Resolve a FunctionHandleIndex into a FunctionRef in either the cache or the `fetcher`.
Resolve a FunctionHandleIndex into a FunctionRef in either the cache or the ` fetcher ` .
&self
caller_module
&LoadedModule
idx
FunctionHandleIndex
fetcher
&F