fuel_core_client/client/pagination.rs
1/// Specifies the direction of a paginated query
2#[derive(Copy, Clone, Debug, PartialEq, Eq)]
3pub enum PageDirection {
4 Forward,
5 Backward,
6}
7
8/// Used to parameterize paginated queries
9#[derive(Clone, Debug)]
10pub struct PaginationRequest<T> {
11 /// The cursor returned from a previous query to indicate an offset
12 pub cursor: Option<T>,
13 /// The number of results to take
14 pub results: i32,
15 /// The direction of the query (e.g. asc, desc order).
16 pub direction: PageDirection,
17}
18
19#[derive(Clone, Debug)]
20pub struct PaginatedResult<T, C> {
21 pub cursor: Option<C>,
22 pub results: Vec<T>,
23 pub has_next_page: bool,
24 pub has_previous_page: bool,
25}