Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
dthul
on March 10, 2021
|
parent
|
context
|
favorite
| on:
Why asynchronous Rust doesn't work
Note that you don't need a closure in Rust to start a thread. You can just specify a function to be called (because functions implement FnOnce).
scoutt
on March 10, 2021
[–]
Thanks. My question emerged from the fact that all the Rust threads examples I see are in the closure form
|| {}
.
zesterer
on March 10, 2021
|
parent
[–]
Because the closure form is much more useful. You very rarely want to create a thread without first passing some state to it, and environment-passing with closures is a brilliantly ergonomic way to do this.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: