Trait Pagination

Source
pub trait Pagination {
    type Item: DeserializeOwned;

    // Required methods
    fn has_more_pages(&self) -> bool;
    fn next_page(&self, req: Request) -> Result<Request, Error>;
    fn items(&self) -> Vec<Self::Item>;
}
Expand description

A trait for types that allow pagination.

Required Associated Types§

Source

type Item: DeserializeOwned

The item that is paginated.

Required Methods§

Source

fn has_more_pages(&self) -> bool

Returns true if the response has more pages.

Source

fn next_page(&self, req: Request) -> Result<Request, Error>

Modify a request to get the next page.

Source

fn items(&self) -> Vec<Self::Item>

Get the items from a page.

Implementors§