pub struct PaginatorResponse<T> {
pub data: Vec<T>,
pub meta: PaginatorResponseMeta,
}Fields§
§data: Vec<T>§meta: PaginatorResponseMetaImplementations§
Source§impl<T: Serialize> PaginatorResponse<T>
impl<T: Serialize> PaginatorResponse<T>
Sourcepub fn with_cursors(self, field: &str) -> Self
pub fn with_cursors(self, field: &str) -> Self
Attach next_cursor/prev_cursor keyed on field to an offset page, so a
client can switch from page numbers to keyset pagination.
This is the usual way to hand out the first cursor: serve page 1 with
offset pagination, call with_cursors("id"), and let the client follow
next_cursor from there. Cursors already present on the response are kept.
A cursor is only attached when the corresponding side has more rows
(has_next/has_prev), the page is not empty, and field can be read
from the serialized boundary row.
Trait Implementations§
Source§impl<T: Debug> Debug for PaginatorResponse<T>
impl<T: Debug> Debug for PaginatorResponse<T>
Source§impl<'de, T> Deserialize<'de> for PaginatorResponse<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for PaginatorResponse<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<T> Freeze for PaginatorResponse<T>
impl<T> RefUnwindSafe for PaginatorResponse<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for PaginatorResponse<T>
impl<T> Sync for PaginatorResponse<T>
impl<T> Unpin for PaginatorResponse<T>
impl<T> UnsafeUnpin for PaginatorResponse<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for PaginatorResponse<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