Struct dropshot::ResultsPage
source · pub struct ResultsPage<ItemType> {
pub next_page: Option<String>,
pub items: Vec<ItemType>,
}
Expand description
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§
source§impl<ItemType> ResultsPage<ItemType>
impl<ItemType> ResultsPage<ItemType>
sourcepub fn new<F, ScanParams, PageSelector>(
items: Vec<ItemType>,
scan_params: &ScanParams,
get_page_selector: F
) -> Result<ResultsPage<ItemType>, HttpError>
pub fn new<F, ScanParams, PageSelector>( items: Vec<ItemType>, scan_params: &ScanParams, get_page_selector: F ) -> Result<ResultsPage<ItemType>, HttpError>
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§
source§impl<ItemType: Debug> Debug for ResultsPage<ItemType>
impl<ItemType: Debug> Debug for ResultsPage<ItemType>
source§impl<'de, ItemType> Deserialize<'de> for ResultsPage<ItemType>where
ItemType: Deserialize<'de>,
impl<'de, ItemType> Deserialize<'de> for ResultsPage<ItemType>where
ItemType: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<ItemType> JsonSchema for ResultsPage<ItemType>where
ItemType: JsonSchema,
impl<ItemType> JsonSchema for ResultsPage<ItemType>where
ItemType: JsonSchema,
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreAuto 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§
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