Open mkroman opened 2 years ago
Thank you for your issue! I think this has already been resolved with Octocrab::all_pages
if you want to eagerly get all items, it hasn't been released yet, but I intend to make a release soon. https://github.com/XAMPPRocky/octocrab/blob/master/src/lib.rs#L875
Yes, I'd ideally like to make Page<T>
an iterator, however we're still a long ways off from async iterators being stable, which is what we'd require to give a nice API.
Ah, I wasn't aware of all_pages
. That helps a bit - thanks!
however we're still a long ways off from async iterators being stable,
True, but even something like while let
will go a long way for certain things :slightly_smiling_face:
Adding a permalink for those who are looking for the all_pages
method linked above:
It's currently quite cumbersome to iterate over pages on a resource.
It would be great if resources that return a list with multiple pages instead return an iterator that makes it easy to iterate over elements and have the iterator automatically fetch subsequent pages.
Instead of this:
I imagine something like this: