3 ms·
Rust uses async/await based concurrency: https://rust-lang.github.io/async-book/01_getting_started/01_chapter.html https://rust-lang.github.io/async-book/01_get
by duped 5y ago
Rust uses async/await based concurrency: https://rust-lang.github.io/async-book/01_getting_started/01_chapter.html https://rust-lang.github.io/async-book/01_getting_started/01...
There are a variety of async channel structures, for example:
smol channels: https://docs.rs/smol/0.4.3/smol/channel/index.html https://docs.rs/smol/0.4.3/smol/channel/index.html
async std channels: https://docs.rs/async-std/1.4.0/async_std/sync/fn.channel.html https://docs.rs/async-std/1.4.0/async_std/sync/fn.channel.ht...
tokio channels : https://tokio.rs/tokio/tutorial/channels https://tokio.rs/tokio/tutorial/channels
One difference between Rust and Go is that Rust does not have a runtime by default, which means async/await needs an "executor." Some popular ones are async std, smol, and tokio.
If you want to use OS threads directly for parallelism (which is not concurrency, but is related) then you can use std::thread, and a variety of synchronous channels for inter-thread communication.