pub struct CursorPage<T> {
pub items: Vec<T>,
pub next_cursor: Option<String>,
}Expand description
A single page of cursor (keyset) paginated results.
Unlike Page, there is no total_items/total_pages — computing those
would require a separate COUNT(*) query, which is exactly what keyset
pagination avoids. All you get (and all you need to fetch the next page)
is next_cursor.
Fields§
§items: Vec<T>§next_cursor: Option<String>Opaque cursor to pass back for the next page. None means this is the last page.
Implementations§
Source§impl<T> CursorPage<T>
impl<T> CursorPage<T>
Trait Implementations§
Source§impl<T: Clone> Clone for CursorPage<T>
impl<T: Clone> Clone for CursorPage<T>
Source§fn clone(&self) -> CursorPage<T>
fn clone(&self) -> CursorPage<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for CursorPage<T>
impl<T: Debug> Debug for CursorPage<T>
Source§impl<T: PartialEq> PartialEq for CursorPage<T>
impl<T: PartialEq> PartialEq for CursorPage<T>
Source§fn eq(&self, other: &CursorPage<T>) -> bool
fn eq(&self, other: &CursorPage<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T: PartialEq> StructuralPartialEq for CursorPage<T>
Auto Trait Implementations§
impl<T> Freeze for CursorPage<T>
impl<T> RefUnwindSafe for CursorPage<T>where
T: RefUnwindSafe,
impl<T> Send for CursorPage<T>where
T: Send,
impl<T> Sync for CursorPage<T>where
T: Sync,
impl<T> Unpin for CursorPage<T>where
T: Unpin,
impl<T> UnsafeUnpin for CursorPage<T>
impl<T> UnwindSafe for CursorPage<T>where
T: UnwindSafe,
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