Expand description
Cursor-based pagination primitives.
WorkOS list endpoints return a JSON envelope of the form
{ "data": [...], "list_metadata": { "before": ..., "after": ... } }.
The two structs in this module model that envelope; auto_paginate
drives a paginated endpoint to exhaustion as an async stream so callers
don’t have to manage the cursor manually.
Structs§
- List
Metadata - Cursor pair attached to every list response. Pass
Self::after(orSelf::before) back as theafter/beforequery parameter on the next request to advance through the result set. - Page
- One page of a paginated list response.
dataholds the items andlist_metadatacarries the cursor used to fetch the next page.
Functions§
- auto_
paginate - Drive a paginated endpoint to exhaustion as an async stream of items.