I managed to read a file asynchronously with Rust, and let me tell you: it was an adventure. In case anyone wants to do async disk IO in the future, here's a reference: https://github.com/yoshuawuyts/spec-rust/blob/master/examples/futures.rs …
Haha, yeah - async disk IO was only added 4 weeks ago. I think with a bit of time it'll be so much nicer. If read_to_string() + async/await becomes available: let file = path::Path::new("./README.md"); let string = await fs::read_to_string(file)?; https://doc.rust-lang.org/stable/std/fs/fn.read_to_string.html …
-
-
Also the explicit event loop stuff will probably get some nicer constructors eventually. Maybe it'll even be folded into the language once it's prominent everywhere! Tiny steps win no races; but I'm feeling like the end result will be way ahead of what Node, Go or C++ can offer.
-
Hm, okay; still, what’s with fs:file::File or what ever? How many times do you need to know you’re dealing with a file?
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.