[][src]Struct rick_and_morty::PageResponse

pub struct PageResponse<T> {
    pub results: Vec<T>,
    pub info: Info,

PageResponse is a helper struct matching the shape of the returned json object when a call returned paginated results.

Each object has a helper method next() that returns the next page until exhausted.


results: Vec<T>

the slice of results (e.g Vec<Character>)

info: Info

the pagination object for the page.


impl<T> PageResponse<T>[src]

pub async fn next<'_>(&'_ self) -> Result<Option<PageResponse<T>>, Error> where
    T: DeserializeOwned

next gets the next PageResponse object, if any.

Can be a more efficent way of lazily fetching all entities for an endpoint instead of calling get_all.

Trait Implementations

impl<T: Clone> Clone for PageResponse<T>[src]

impl<T: Debug> Debug for PageResponse<T>[src]

impl<T: Default> Default for PageResponse<T>[src]

impl<'de, T> Deserialize<'de> for PageResponse<T> where
    T: Deserialize<'de>, 

impl<T: PartialEq> PartialEq<PageResponse<T>> for PageResponse<T>[src]

impl<T> Serialize for PageResponse<T> where
    T: Serialize

impl<T> StructuralPartialEq for PageResponse<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for PageResponse<T> where
    T: RefUnwindSafe

impl<T> Send for PageResponse<T> where
    T: Send

impl<T> Sync for PageResponse<T> where
    T: Sync

impl<T> Unpin for PageResponse<T> where
    T: Unpin

impl<T> UnwindSafe for PageResponse<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.