8 ms·
Not necessarily. They're an implementation detail of the compiler, and aren't fully baked yet to boot. But there's plenty of reason to want generators, includi
by tmandry 7y ago
Not necessarily. They're an implementation detail of the compiler, and aren't fully baked yet to boot.
But there's plenty of reason to want generators, including the fact that they let you build streams. And the fact that async/await relies heavily on them has pushed the implementation much closer to being ready. I hope we get them at some point!
- richardwhiuk 7y agoThey are available in nightly - https://doc.rust-lang.org/beta/unstable-book/language-features/generators.html https://doc.rust-lang.org/beta/unstable-book/language-featur... - but are very unstable. I think "at some point" is the best answer :)
- steveklabnik 7y agoTo be clear on how unstable: they have not received an actual RFC yet, so they’re barely designed at all. It will be some time before they’re stable, as in some sense, they haven’t even started the process. I’d imagine that they would go through the stages faster than many other features, though, given that they implementation will have received a lot of testing via async/await.