pub struct Paginator<'a> { /* private fields */ }Expand description
Build a collection’s pagination links.
The URLs a client follows rather than assembling: self always, first
and prev when there is somewhere back to go, next when there is more,
and last only when the total is known. Sort keys are carried across
every link, so following next does not silently reorder the collection.
Implementations§
Source§impl<'a> Paginator<'a>
impl<'a> Paginator<'a>
Sourcepub fn links(
&self,
returned: usize,
total: Option<usize>,
cursor: Option<&str>,
has_more: Option<bool>,
) -> Links
pub fn links( &self, returned: usize, total: Option<usize>, cursor: Option<&str>, has_more: Option<bool>, ) -> Links
The links for one page.
returned is how many rows this page actually holds, total the size
of the collection when storage counted it, cursor where the next
page resumes under cursor paging, and has_more whether the
collection continues past this page when storage knows exactly.
Auto Trait Implementations§
impl<'a> Freeze for Paginator<'a>
impl<'a> RefUnwindSafe for Paginator<'a>
impl<'a> Send for Paginator<'a>
impl<'a> Sync for Paginator<'a>
impl<'a> Unpin for Paginator<'a>
impl<'a> UnsafeUnpin for Paginator<'a>
impl<'a> UnwindSafe for Paginator<'a>
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