Skip to content

Commit e6b9e77

Browse files
committed
add trait impl back in
1 parent 158eaba commit e6b9e77

File tree

1 file changed

+6
-0
lines changed
  • develop-docs/engineering-practices

1 file changed

+6
-0
lines changed

develop-docs/engineering-practices/rust.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ and should generally be preferred now.
5757
pub trait Database {
5858
fn get_user(&self) -> impl Future<Output = User> + Send;
5959
}
60+
61+
impl Database for MyDatabase {
62+
async fn get_user(&self) -> User {
63+
todo!()
64+
}
65+
}
6066
```
6167

6268
Note that the returned future type is `Send`, to ensure that it can run on a multi-threaded runtime.

0 commit comments

Comments
 (0)