Pegination
Implementation of cursor pagination. See the tests for details.
Requirements
1. Structure SourceRequest
Source request sent to API
2. Structure Filters
Data source filters, excludes limit and offset
3. Structure Item
Data source entity
4. Entity Error
Required implementations
1. SourceRequest to Filters transormation
2. WithCursor for SearchRequest
3. WithLimit for SourceRequest
4. DataSource
Usage
Having all of the stuff described above, you can use pagination function this way:
const DEFAULT_LIMIT: u16 = 100;
let paginated_data = .await?;
// {
// "last_cursor": null,
// "has_next_page": false,
// "data": [
// ..items
// ]
// }