(no title)
kurtbuilds | 2 years ago
trait HttpService: Send {
fn fetch(&self, url: Url)
-> impl Future<Output = HtmlBody> + Send;
}
impl HttpService for MyService {
async fn fetch(&self, url: Url) -> HtmlBody {
// This works, as long as `do_fetch(): Send`!
self.client.do_fetch(url).await.into_body()
}
}
gdcbe|2 years ago
Edit: also the problem is about the method async returned future trait bounds, not the Self.