space_traders/models/
meta.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// Meta details for pagination.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct Meta {
10    /// Shows the total amount of items of this kind that exist.
11    #[serde(rename = "total")]
12    pub total: u32,
13    /// A page denotes an amount of items, offset from the first item. Each page holds an amount of items equal to the `limit`.
14    #[serde(rename = "page")]
15    pub page: u32,
16    /// The amount of items in each page. Limits how many items can be fetched at once.
17    #[serde(rename = "limit")]
18    pub limit: u32,
19}
20
21impl Meta {
22    /// Create value with optional fields set to `None`.
23    #[allow(clippy::too_many_arguments)]
24    pub fn new(total: u32, page: u32, limit: u32) -> Meta {
25        Meta { total, page, limit }
26    }
27}