pub struct PaginationResponse<T> {
pub items: Vec<T>,
pub current_page: usize,
pub items_per_page: usize,
pub total_pages: usize,
pub total_items: usize,
}
Expand description
PaginationResponse
struct is used to store the paginated response from the API.
Fields§
§items: Vec<T>
§current_page: usize
§items_per_page: usize
§total_pages: usize
§total_items: usize
Implementations§
Source§impl<T> PaginationResponse<T>
impl<T> PaginationResponse<T>
Sourcepub fn from_headers(
items: Vec<T>,
map: &HeaderMap,
) -> Result<Self, DeserializeError>
pub fn from_headers( items: Vec<T>, map: &HeaderMap, ) -> Result<Self, DeserializeError>
Create a new PaginationResponse
instance from items and Trakt.tv API response headers.
§Errors
Returns a DeserializeError
if the headers are missing or if the header values are not valid.
pub const fn next_page(&self) -> Option<Pagination>
Trait Implementations§
Source§impl<T: Clone> Clone for PaginationResponse<T>
impl<T: Clone> Clone for PaginationResponse<T>
Source§fn clone(&self) -> PaginationResponse<T>
fn clone(&self) -> PaginationResponse<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for PaginationResponse<T>
impl<T: Debug> Debug for PaginationResponse<T>
Source§impl<T: Hash> Hash for PaginationResponse<T>
impl<T: Hash> Hash for PaginationResponse<T>
Source§impl<T: PartialEq> PartialEq for PaginationResponse<T>
impl<T: PartialEq> PartialEq for PaginationResponse<T>
impl<T: Eq> Eq for PaginationResponse<T>
impl<T> StructuralPartialEq for PaginationResponse<T>
Auto Trait Implementations§
impl<T> Freeze for PaginationResponse<T>
impl<T> RefUnwindSafe for PaginationResponse<T>where
T: RefUnwindSafe,
impl<T> Send for PaginationResponse<T>where
T: Send,
impl<T> Sync for PaginationResponse<T>where
T: Sync,
impl<T> Unpin for PaginationResponse<T>where
T: Unpin,
impl<T> UnwindSafe for PaginationResponse<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