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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. 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