I want to forward a function to a method in another module, without repeating all the type annotations, and without manually passing the parameters over. How would I do this?
mod other_mod;
static client: other_mod::Client = other_mod::Client::new();
async fn search = client.search; // How to do this here?
mod other_mod
:
pub struct Client();
impl Client {
pub fn new() -> Self {
Self()
}
pub async fn search(&self, query: &str) -> Result<Vec<SearchResultItem>> { ... }
}