pub struct Page<T> {
pub items: Vec<T>,
pub total: u64,
pub page: u64,
pub per_page: u64,
}Expand description
A page of results returned from a repository query.
Fields§
§items: Vec<T>The items in this page.
total: u64The total number of items across all pages.
page: u64The 1-based page number of this page.
per_page: u64The number of items per page.
Implementations§
Source§impl<T> Page<T>
impl<T> Page<T>
Sourcepub fn total_pages(&self) -> u64
pub fn total_pages(&self) -> u64
Returns the total number of pages.
Sourcepub fn has_next_page(&self) -> bool
pub fn has_next_page(&self) -> bool
Returns true if there is a page after this one.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Page<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Page<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 Page<T>
impl<T> RefUnwindSafe for Page<T>where
T: RefUnwindSafe,
impl<T> Send for Page<T>where
T: Send,
impl<T> Sync for Page<T>where
T: Sync,
impl<T> Unpin for Page<T>where
T: Unpin,
impl<T> UnsafeUnpin for Page<T>
impl<T> UnwindSafe for Page<T>where
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