pub struct PageParams {
pub limit: usize,
pub offset: usize,
}Expand description
Query parameters for a paginated list route: ?limit=&offset=.
Fields§
§limit: usize§offset: usizeImplementations§
Source§impl PageParams
impl PageParams
Sourcepub fn clamped(self, max: usize) -> Self
pub fn clamped(self, max: usize) -> Self
Clamp limit to max. This is opt-in — the type itself does not
enforce a bound, so callers that build a Page from client-supplied
PageParams must call this (or otherwise validate limit) before
passing the params to a query; nothing at the type level prevents
skipping this step.
Trait Implementations§
Source§impl Clone for PageParams
impl Clone for PageParams
Source§fn clone(&self) -> PageParams
fn clone(&self) -> PageParams
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 Debug for PageParams
impl Debug for PageParams
Source§impl Default for PageParams
impl Default for PageParams
Source§impl<'de> Deserialize<'de> for PageParamswhere
PageParams: Default,
impl<'de> Deserialize<'de> for PageParamswhere
PageParams: Default,
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
Source§impl PartialEq for PageParams
impl PartialEq for PageParams
Source§fn eq(&self, other: &PageParams) -> bool
fn eq(&self, other: &PageParams) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for PageParams
impl Eq for PageParams
impl StructuralPartialEq for PageParams
Auto Trait Implementations§
impl Freeze for PageParams
impl RefUnwindSafe for PageParams
impl Send for PageParams
impl Sync for PageParams
impl Unpin for PageParams
impl UnsafeUnpin for PageParams
impl UnwindSafe for PageParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.