Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here is a small TCP client example: https://github.com/rustasync/runtime/blob/master/examples/tc...

Note "async fn main" on line 15, and the ".await"s on 21 and 24.

Now, if you read my other comment about executors, this is using a crate called "runtime", which handles submitting it for you, see the `#[]` bit on line 14. Regardless, the syntax would look like this even without this crate; it just removes some boilerplate around the executor and submitting your future to it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: