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 …
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?
-
`fs::File` is equally valid; `fs::file::File` was just me being sloppy in the example. in this case `fs` is the crate name, `file` is a submodule, and `File` is the struct. But yeah, usually you'd use `fs::read_to_string()` instead for convenience. Easier :D
- 1 more reply
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.