crunchy-labs / crunchyroll-rs

🦀 Pure Rust implementation of the Crunchyroll API
Apache License 2.0
58 stars 13 forks source link

Add pagination #8

Closed bytedream closed 1 year ago

bytedream commented 1 year ago

This PR adds pagination support. Until now, the number of results on pagination endpoints (e.g. Crunchyroll::browse) must be specified manually. The Pagination struct takes over this process. With the help of future_util::stream::Stream you can iterate over a pagination result and it will fetch the data as required. You might have to add futures_util to your dependencies and use future_util::stream::Stream to gain access to some functions.

Functions which are returning Pagination now:

This PR also updates the format! macro to use inlined arguments.