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§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>
impl<T: PartialEq> StructuralPartialEq for CursorPage<T>
Auto Trait Implementations§
impl<T> Freeze for CursorPage<T>
impl<T> RefUnwindSafe for CursorPage<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for CursorPage<T>
impl<T> Sync for CursorPage<T>
impl<T> Unpin for CursorPage<T>
impl<T> UnsafeUnpin for CursorPage<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for CursorPage<T>where
Vec<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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more