[][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.

Fields

results: Vec<T>

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

info: Info

the pagination object for the page.

Implementations

impl<T> PageResponse<T>[src]

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

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>, 
[src]

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

impl<T> Serialize for PageResponse<T> where
    T: Serialize
[src]

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

Auto Trait Implementations

impl<T> RefUnwindSafe for PageResponse<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for PageResponse<T> where
    T: Send
[src]

impl<T> Sync for PageResponse<T> where
    T: Sync
[src]

impl<T> Unpin for PageResponse<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for PageResponse<T> where
    T: UnwindSafe
[src]

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.