We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 158eaba commit e6b9e77Copy full SHA for e6b9e77
develop-docs/engineering-practices/rust.mdx
@@ -57,6 +57,12 @@ and should generally be preferred now.
57
pub trait Database {
58
fn get_user(&self) -> impl Future<Output = User> + Send;
59
}
60
+
61
+impl Database for MyDatabase {
62
+ async fn get_user(&self) -> User {
63
+ todo!()
64
+ }
65
+}
66
```
67
68
Note that the returned future type is `Send`, to ensure that it can run on a multi-threaded runtime.
0 commit comments