pub enum PaginationStyle {
None,
Cursor {
next_token_path: String,
param_name: String,
},
LinkHeader,
NextLinkInBody {
next_link_path: String,
},
PageNumber {
param_name: String,
start_page: usize,
page_size: Option<usize>,
page_size_param: Option<String>,
},
Offset {
offset_param: String,
limit_param: String,
limit: usize,
total_path: Option<String>,
},
}Expand description
Supported pagination strategies.
Variants§
None
Cursor
LinkHeader
NextLinkInBody
The full URL of the next page is embedded in the response body.
next_link_path is a JSONPath expression pointing to that URL field
(e.g. "$.next_link"). Pagination stops when the field is absent,
null, or an empty string.
PageNumber
Fields
Offset
Implementations§
Source§impl PaginationStyle
impl PaginationStyle
pub fn apply_params( &self, params: &mut HashMap<String, String>, state: &PaginationState, )
Sourcepub fn advance(
&self,
body: &Value,
headers: &HeaderMap,
state: &mut PaginationState,
record_count: usize,
) -> Result<bool, FaucetError>
pub fn advance( &self, body: &Value, headers: &HeaderMap, state: &mut PaginationState, record_count: usize, ) -> Result<bool, FaucetError>
Advance pagination state based on the response body and headers.
Returns true if there is a next page to fetch.
Includes loop detection: if a cursor or next-link value is identical to the previous page’s value, pagination stops with a warning instead of looping forever.
Trait Implementations§
Source§impl Clone for PaginationStyle
impl Clone for PaginationStyle
Source§fn clone(&self) -> PaginationStyle
fn clone(&self) -> PaginationStyle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PaginationStyle
impl Debug for PaginationStyle
Source§impl<'de> Deserialize<'de> for PaginationStyle
impl<'de> Deserialize<'de> for PaginationStyle
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 JsonSchema for PaginationStyle
impl JsonSchema for PaginationStyle
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for PaginationStyle
impl RefUnwindSafe for PaginationStyle
impl Send for PaginationStyle
impl Sync for PaginationStyle
impl Unpin for PaginationStyle
impl UnsafeUnpin for PaginationStyle
impl UnwindSafe for PaginationStyle
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