pub struct PaginationParams {
pub page: u32,
pub per_page: u32,
}Expand description
Pagination parameters
Fields§
§page: u32§per_page: u32Implementations§
Source§impl PaginationParams
impl PaginationParams
Sourcepub const MAX_PER_PAGE: u32 = 100
pub const MAX_PER_PAGE: u32 = 100
The most rows one page may hold. Every list the generic repositories serve is capped here, whatever page size the caller asked for.
Sourcepub fn new(page: u32, per_page: u32) -> Self
pub fn new(page: u32, per_page: u32) -> Self
A page request, normalized: page 0 reads as page 1, and the page size is held to
1..=MAX_PER_PAGE. Build pagination through this rather than
a struct literal, which skips both.
Sourcepub fn offset(&self) -> u32
pub fn offset(&self) -> u32
The rows to skip. Page 0 counts as page 1, so a literal that skipped Self::new
still never underflows.
pub fn limit(&self) -> u32
Trait Implementations§
Source§impl Clone for PaginationParams
impl Clone for PaginationParams
Source§impl Debug for PaginationParams
impl Debug for PaginationParams
Auto Trait Implementations§
impl Freeze for PaginationParams
impl RefUnwindSafe for PaginationParams
impl Send for PaginationParams
impl Sync for PaginationParams
impl Unpin for PaginationParams
impl UnsafeUnpin for PaginationParams
impl UnwindSafe for PaginationParams
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