pub struct PageMetadata { /* private fields */ }Expand description
Validated metadata from one paginated provider response.
Implementations§
Source§impl PageMetadata
impl PageMetadata
Sourcepub const fn new(
page: PageNumber,
per_page: u64,
previous_page: Option<PageNumber>,
next_page: Option<PageNumber>,
last_page: Option<PageNumber>,
total_entries: Option<u64>,
) -> Result<Self, PaginationError>
pub const fn new( page: PageNumber, per_page: u64, previous_page: Option<PageNumber>, next_page: Option<PageNumber>, last_page: Option<PageNumber>, total_entries: Option<u64>, ) -> Result<Self, PaginationError>
Creates coherent page navigation metadata.
Sourcepub const fn page(self) -> PageNumber
pub const fn page(self) -> PageNumber
Returns the current page.
Sourcepub const fn previous_page(self) -> Option<PageNumber>
pub const fn previous_page(self) -> Option<PageNumber>
Returns the previous page when advertised.
Sourcepub const fn next_page(self) -> Option<PageNumber>
pub const fn next_page(self) -> Option<PageNumber>
Returns the next page when advertised.
Sourcepub const fn last_page(self) -> Option<PageNumber>
pub const fn last_page(self) -> Option<PageNumber>
Returns the final page when known.
Sourcepub const fn total_entries(self) -> Option<u64>
pub const fn total_entries(self) -> Option<u64>
Returns the total matching entries when known.
Trait Implementations§
Source§impl Clone for PageMetadata
impl Clone for PageMetadata
Source§fn clone(&self) -> PageMetadata
fn clone(&self) -> PageMetadata
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 moreimpl Copy for PageMetadata
Source§impl Debug for PageMetadata
impl Debug for PageMetadata
impl Eq for PageMetadata
Source§impl PartialEq for PageMetadata
impl PartialEq for PageMetadata
impl StructuralPartialEq for PageMetadata
Auto Trait Implementations§
impl Freeze for PageMetadata
impl RefUnwindSafe for PageMetadata
impl Send for PageMetadata
impl Sync for PageMetadata
impl Unpin for PageMetadata
impl UnsafeUnpin for PageMetadata
impl UnwindSafe for PageMetadata
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