Expand description
Pagination types for list endpoints.
Supports both offset-based and cursor-based pagination patterns.
All types are framework-agnostic — consumers add their own framework
derives (e.g. utoipa::ToSchema, utoipa::IntoParams).
§Choosing a pagination strategy
§Offset-based (PaginatedResponse + PaginationParams)
- Best for: admin dashboards, internal tools, small bounded datasets
- Supports: random page access (jump to page N), total count
- Trade-off: pages can shift when rows are inserted/deleted between requests
- Use when: dataset is small (<10k rows), real-time consistency is not critical
§Cursor-based (CursorPaginatedResponse + CursorPaginationParams)
- Best for: public APIs, feeds, large or live datasets
- Supports: stable iteration (no skipped/duplicate items on insert)
- Trade-off: no random page access, no total count
- Use when: dataset is large or frequently mutated, API is public-facing
- Industry standard: Stripe, GitHub, Slack all use cursor-based for list endpoints
Structs§
- Cursor
Paginated Response - Cursor-based paginated response envelope (PLATFORM-003).
- Cursor
Pagination - Cursor-based pagination metadata (PLATFORM-003).
- Cursor
Pagination Params - Query parameters for cursor-based list endpoints.
- Keyset
Paginated Response - A page of results from a keyset-paginated endpoint.
- Keyset
Pagination Params - Query parameters for keyset (seek-based) pagination.
- Paginated
Response - Offset-based paginated response envelope with a flat shape.
- Pagination
Params - Query parameters for offset-based list endpoints.