futures-rs icon indicating copy to clipboard operation
futures-rs copied to clipboard

Peekable::try_peek

Open nazar-pc opened this issue 2 years ago • 1 comments

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.

nazar-pc avatar Oct 27 '23 12:10 nazar-pc

Seems reasonable to me.

taiki-e avatar Oct 27 '23 13:10 taiki-e