pub struct Page<T> { /* private fields */ }Expand description
One page of a paginated collection: the decoded items plus the parsed
rel="next" cursor (ADR-0009).
Obtain the next page manually with next, or follow the whole
chain lazily with into_stream.
Implementations§
Source§impl<T: DeserializeOwned + Send + 'static> Page<T>
impl<T: DeserializeOwned + Send + 'static> Page<T>
Sourcepub async fn next(&self) -> Result<Option<Page<T>>>
pub async fn next(&self) -> Result<Option<Page<T>>>
Fetches the next page, or None when the current page is the last.
Sourcepub fn into_stream(self) -> impl Stream<Item = Result<T>> + Send
pub fn into_stream(self) -> impl Stream<Item = Result<T>> + Send
Streams every item across all pages, following next links until the
collection is exhausted. Starts from this page’s already-fetched items.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Page<T>
impl<T> !UnwindSafe for Page<T>
impl<T> Freeze for Page<T>
impl<T> Send for Page<T>where
T: Send,
impl<T> Sync for Page<T>where
T: Sync,
impl<T> Unpin for Page<T>where
T: Unpin,
impl<T> UnsafeUnpin for Page<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more