I want to store a few function pointers following the similar interface (all are async
s, have the same arguments and the same return value) in a vector, so that I could iterate over each of those and call them with my arguments and get results.
playground
struct Profile;
async fn get_steam_profile_info(id: &str) -> Result<Profile, ()> { Ok(Profile) }
async fn get_fortnite_profile_info(id: &str) -> Result<Profile, ()> { Ok(Profile) }
fn main() {
let fetchers = vec![get_steam_profile_info, get_fortnite_profile_info];
}