Migrating to futures::Stream
for all iter_*
method
#295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR I plan to rewrite all
iter_*
methods to usefutures::Stream
instead of manual iterator implementation.Using
futures::Stream
could give us some very good advantages, for example there are tons of useful traits infutures
that we can then use with ourStream
's and its also overall a more standard way then what we are doing right now.Todo:
iter_download
=>stream_download
iter_dialogs
=>stream_dialogs
iter_participants
=>stream_participants
iter_profile_photos
=>stream_profile_photos
iter_messages
=>stream_messages
search_messages
=>search_messages
search_all_messages
=>search_all_messages
Questions:
stream_*
? or is there better namesfutures
crate?pin_mut
macro everywhere doesn't seems like a good idea, what else should we do? should we implement custom future for lower level types?