pub struct Paginator<T, E> { /* private fields */ }Implementations§
Source§impl<T, E> Paginator<T, E>
impl<T, E> Paginator<T, E>
pub fn new<F>(fetch: F, initial_cursor: Option<PaginationCursor>) -> Self
pub async fn first_page(&mut self) -> Result<Page<T>, E>
pub fn from_cursor( cursor: Option<PaginationCursor>, fetch: impl FnMut(Option<PaginationCursor>) -> Pin<Box<dyn Future<Output = Result<Page<T>, E>> + Send>> + Send + 'static, ) -> Self
pub async fn next_page(&mut self) -> Result<Option<Page<T>>, E>
pub async fn collect_all(&mut self) -> Result<Vec<Page<T>>, E>
Auto Trait Implementations§
impl<T, E> !RefUnwindSafe for Paginator<T, E>
impl<T, E> !Sync for Paginator<T, E>
impl<T, E> !UnwindSafe for Paginator<T, E>
impl<T, E> Freeze for Paginator<T, E>
impl<T, E> Send for Paginator<T, E>
impl<T, E> Unpin for Paginator<T, E>
impl<T, E> UnsafeUnpin for Paginator<T, E>
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