Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use GAT to redesign trait Stream #316

Open
Sherlock-Holo opened this issue Jun 12, 2023 · 3 comments
Open

use GAT to redesign trait Stream #316

Sherlock-Holo opened this issue Jun 12, 2023 · 3 comments

Comments

@Sherlock-Holo
Copy link

for now Stream can't write something like
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b45f2bc81394150cdae15d8a1cbcdecd

which want to return a reference type,

however, with GAT help
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b63d58ebe8d9ffa70225d5fc23fb629d

we can return the reference type

consider Stream still not in the std lib, maybe we still have chance to redesign it

@taiki-e taiki-e transferred this issue from rust-lang/futures-rs Jun 12, 2023
@taiki-e
Copy link
Member

taiki-e commented Jun 12, 2023

Since wg-async is investigating/discussing the new design of stream trait, I transfer this there.

@Berrysoft
Copy link

Stream is actually in the std, which names std::async_iter::AsyncIterator. It's a nightly feature.

@Sherlock-Holo
Copy link
Author

AsyncIterator is not stable, that means still have a chance to redesign it, like the try trait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants