<devils-advocate>
To do this, you need buffering so you can look ahead. But that means allocating a global, shared buffer. And all access to stdin has to go through it, or you’ll end up dropping input. That imposes a perf and memory cost on everyone whether or not they use it. Yuck. As it happens, stdin is already globally buffered.
But let’s say that gets added, and it only gives you the ability to read integers. What’s so special about integers? What about floats, and bools? What about user-defined types like integer newtypes or NaN-free floats? Surely users should be able to support this?
But Rust has nothing appropriate defined for such general-purpose parsing. The existing FromStr machinery is wholly insufficient. So now you’re having to bolt a parsing system on to the standard library and… it’s just simpler to push this to an external crate like anything else in Rust that doesn’t need to be in the standard library.
If you’re doing this frequently, either use an existing crate, or define your own.
</devils-advocate>