[][src]Struct dropshot::ResultsPage

pub struct ResultsPage<ItemType> {
    pub next_page: Option<String>,
    pub items: Vec<ItemType>,
}

A page of results from a paginated API

This structure is intended for use both on the server side (to generate the results page) and on the client side (to parse it).

Fields

next_page: Option<String>

token used to fetch the next page of results (if any)

items: Vec<ItemType>

list of items on this page of results

Implementations

impl<ItemType> ResultsPage<ItemType>[src]

pub fn new<F, ScanParams, PageSelector>(
    items: Vec<ItemType>,
    scan_params: &ScanParams,
    get_page_selector: F
) -> Result<ResultsPage<ItemType>, HttpError> where
    F: Fn(&ItemType, &ScanParams) -> PageSelector,
    PageSelector: Serialize
[src]

Construct a new results page from the list of items. page_selector is a function used to construct the page token that clients will provide to fetch the next page of results. scan_params is provided to the page_selector function, since the token may depend on the type of scan.

Trait Implementations

impl<ItemType: Debug> Debug for ResultsPage<ItemType>[src]

impl<'de, ItemType> Deserialize<'de> for ResultsPage<ItemType> where
    ItemType: Deserialize<'de>, 
[src]

impl<ItemType: JsonSchema> JsonSchema for ResultsPage<ItemType>[src]

impl<ItemType> Serialize for ResultsPage<ItemType> where
    ItemType: Serialize
[src]

Auto Trait Implementations

impl<ItemType> RefUnwindSafe for ResultsPage<ItemType> where
    ItemType: RefUnwindSafe

impl<ItemType> Send for ResultsPage<ItemType> where
    ItemType: Send

impl<ItemType> Sync for ResultsPage<ItemType> where
    ItemType: Sync

impl<ItemType> Unpin for ResultsPage<ItemType> where
    ItemType: Unpin

impl<ItemType> UnwindSafe for ResultsPage<ItemType> where
    ItemType: UnwindSafe

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,