mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[PR #166] [MERGED] [WIP/Proposal] Add Stream/Iterator based versions of methods with paginated results #280
Labels
No labels
Stale
bug
discussion
enhancement
good first issue
good first issue
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rspotify#280
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ramsayleung/rspotify/pull/166
Author: @icewind1991
Created: 12/16/2020
Status: ✅ Merged
Merged: 4/19/2021
Merged by: @ramsayleung
Base:
master← Head:streaming📝 Commits (10+)
de3ae9aadd streaming version ofcurrent_user_saved_tracks107d442add sync version ofcurrent_user_saved_tracks_stream15af71afutures-utils -> futures962915eremove dependency on itertoolsed81f59make page size configurable for streaming methods7c670f5use trait aliases to prevent having to write a duplicate implementation for the streaming methodsec10ad2Merge branch 'master' into streaming2f7d180fix lintsbeb2949actually fixes clippy lintad31a00Merge branch 'master' into streaming📊 Changes
12 files changed (+470 additions, -19 deletions)
View changed files
📝
Cargo.toml(+19 -2)📝
examples/oauth_tokens.rs(+5 -5)➕
examples/pagination_async.rs(+75 -0)➕
examples/pagination_manual.rs(+72 -0)➕
examples/pagination_sync.rs(+63 -0)📝
examples/with_refresh_token.rs(+12 -12)📝
src/client.rs(+13 -0)📝
src/lib.rs(+3 -0)➕
src/pagination/iter.rs(+95 -0)➕
src/pagination/mod.rs(+13 -0)➕
src/pagination/stream.rs(+36 -0)📝
tests/test_with_credential.rs(+64 -0)📄 Description
Note, this currently only implements the streaming version for one method to avoid wasting work until we're certain of the design.
Description
Adds an alternative version of methods that return paginated results, providing instead an
IteratororStream(forsync/asyncrespectively)Motivation and Context
Manually iterating over paginated results is pretty annoying to do, by providing an streaming alternative we can make this a lot easier for consumers of the api.
Dependencies
New dependencies:
StreamtraitType of change
How Has This Been Tested?
Added examples using the new methods and running them
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.