-
Notifications
You must be signed in to change notification settings - Fork 89
Closed
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededstatus-quo-story-ideas"Status quo" user story ideas"Status quo" user story ideas
Description
Brief summary
It's very easy to write inherent async fns on a type, but if using them inside a trait method is much harder. For example, this pseudo code doesn't work, and making it work isn't intuitive:
impl Service for Handler {
type Future = WhatTypeGoesHere;
fn call(&self, req: Request) -> Self::Future {
async move {
self.count(req).await;
Ok(self.construct_response())
}
}
}Optional details
- (Optional) Which character(s) would be the best fit and why?
- Any of the characters, since it's hard in general. Barbara may know how to work around it, but she likely still doesn't like it.
- (Optional) What are the key points or morals to emphasize?
- It's confusing that you can't write
async fnwhen implementing a trait. - It's hard to return a future from a trait method that came from another
async fnorasyncblock.
- It's confusing that you can't write
jonhoojonhoo
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededstatus-quo-story-ideas"Status quo" user story ideas"Status quo" user story ideas