I'm trying to write a library that will connect to remote servers and exchange data. I did this in C++ using Boost::Asio and am trying to do the same with Rust.
One of the problems I have is mapping concepts from Asio, like async_write/read to Tokio, starting with the fact that seemingly all Tokio examples demand that I replace my main()
with an async main()
, while I would like to encapsulate all my async code in structures and associated implementations.
Is it possible to use Tokio without replacing main()
? Is mio
perhaps the only way?