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

Peekable::try_peek #2793

Open
nazar-pc opened this issue Oct 27, 2023 · 1 comment
Open

Peekable::try_peek #2793

nazar-pc opened this issue Oct 27, 2023 · 1 comment
Labels
A-stream Area: futures::stream C-feature-request S-needs-implementation Status: Implementation work is needed.

Comments

@nazar-pc
Copy link

nazar-pc commented Oct 27, 2023

Peekable combinator is currenly less useful than it could have been.

I have a use case where it would be helpful to check the next element in a stream (if it is already there) and start preparation for its processing, but at the same time I don't want to delay processing of current element. So I need .try_peek() that is similar to .try_next(), but doesn't advance the stream itself.

@taiki-e taiki-e added C-feature-request A-stream Area: futures::stream S-needs-implementation Status: Implementation work is needed. labels Oct 27, 2023
@taiki-e
Copy link
Member

taiki-e commented Oct 27, 2023

Seems reasonable to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stream Area: futures::stream C-feature-request S-needs-implementation Status: Implementation work is needed.
Projects
None yet
Development

No branches or pull requests

2 participants