I have to ask again about what ought to be a trivial thing.
I had some code that worked in alpha version to read stdin but now in the new stable version none of it (codecs etc) works anymore, everything is suddenly "unimplemented". I am having trouble making any sense of the documentation. The usual problem of lots of weird and wonderful generic type conversions, traits, structs, modules, implementations and what-nots but not a single example on how to actually read anything with it.
How can I SIMPLY adapt:
use tokio::fs;
let contents = fs::read("foo.txt").await?;
so that it will work for stdin instead of "foo.txt"?
Most things in tokio are now behind cargo features (tokio features).
And Tokio's old codec module has moved to tokio-util under the feature codec.
Example
[dependencies]
tokio = { version = "0.2", features = ["io-std", "io-util", "fs", "macros"] }
# use "full" for the complete tokio experience
# tokio = { version = "0.2", features = ["full"] }
# tokio-util = { version = "0.2", features = ["codec"] }