pub struct KeysetPlan<'a> {
pub cursor: &'a Cursor,
pub sort: SortDirection,
pub query_sort: SortDirection,
}Expand description
How a request carrying a cursor is executed.
Keyset pagination selects the rows on the far side of the cursor and takes the
nearest per_page of them. For an After cursor that is the natural sort
order. For a Before cursor the query runs in the reversed order so that
LIMIT picks the rows closest to the cursor, and the page is flipped back into
the caller’s order afterwards (see PaginatorResponseMeta::from_cursor_page).
Fields§
§cursor: &'a Cursor§sort: SortDirectionThe order the caller wants rows in: sort_direction, ascending by default.
query_sort: SortDirectionThe order to put in the query. Equal to sort for After cursors and
reversed for Before cursors.
Implementations§
Source§impl<'a> KeysetPlan<'a>
impl<'a> KeysetPlan<'a>
pub fn field(&self) -> &'a str
pub fn value(&self) -> &'a CursorValue
Sourcepub fn operator(&self) -> &'static str
pub fn operator(&self) -> &'static str
The comparison that selects rows on the far side of the cursor in query
order: > when the query sorts ascending, < when descending.
Sourcepub fn reverse_rows(&self) -> bool
pub fn reverse_rows(&self) -> bool
Whether the fetched rows must be reversed to restore the caller’s order.
Trait Implementations§
Source§impl<'a> Clone for KeysetPlan<'a>
impl<'a> Clone for KeysetPlan<'a>
Source§fn clone(&self) -> KeysetPlan<'a>
fn clone(&self) -> KeysetPlan<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more