pub struct PaginationStream<Item>(/* private fields */);
Expand description
Stream specifically made to support paginators.
PaginationStream
provides two primary mechanisms for accessing stream of data.
- With
.next()
(ortry_next()
):
let mut stream: PaginationStream<Page> = operation_to_yield_paginator();
while let Some(page) = stream.next().await {
// process `page`
}
- With
.collect()
(ortry_collect()
):
let mut stream: PaginationStream<Page> = operation_to_yield_paginator();
let result = stream.collect::<Vec<Page>>().await;
PaginationStream
is implemented in terms of FnStream
, but the latter is meant to be
used internally and not by external users.
Implementations§
source§impl<Item> PaginationStream<Item>
impl<Item> PaginationStream<Item>
source§impl<T, E> PaginationStream<Result<T, E>>
impl<T, E> PaginationStream<Result<T, E>>
Trait Implementations§
Auto Trait Implementations§
impl<Item> Freeze for PaginationStream<Item>
impl<Item> !RefUnwindSafe for PaginationStream<Item>
impl<Item> Send for PaginationStream<Item>where
Item: Send,
impl<Item> !Sync for PaginationStream<Item>
impl<Item> Unpin for PaginationStream<Item>
impl<Item> !UnwindSafe for PaginationStream<Item>
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