1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use crateQueryPaginationParams;
use ;
/// Represents a paginated response with records and metadata.
///
/// This is the standard response structure returned by all paginated queries.
/// It includes the actual records, pagination information, and optionally
/// the total count and total pages.
///
/// # Type Parameters
///
/// * `T` - The type of records being paginated
///
/// # Examples
///
/// ```rust
/// use sqlx_paginated::PaginatedResponse;
/// use serde::Serialize;
///
/// #[derive(Serialize)]
/// struct User {
/// id: i64,
/// name: String,
/// }
///
/// // Response will be serialized as:
/// // {
/// // "records": [...],
/// // "page": 1,
/// // "page_size": 10,
/// // "total": 100,
/// // "total_pages": 10
/// // }
/// ```