chesscom_openapi/models/
chess_stats_last.rs

1/*
2 * Chess
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ChessStatsLast {
16    /// Most-recent rating
17    #[serde(rename = "rating")]
18    pub rating: i32,
19    /// Timestamp of the last rated game finished
20    #[serde(rename = "date")]
21    #[serde(with = "chrono::serde::ts_seconds")]
22	pub date: chrono::DateTime<chrono::Utc>,
23    /// Glicko \"RD\" value used to calculate ratings changes
24    #[serde(rename = "rd")]
25    pub rd: i32,
26}
27
28impl ChessStatsLast {
29    pub fn new(rating: i32, date: chrono::DateTime<chrono::Utc>, rd: i32) -> ChessStatsLast {
30        ChessStatsLast {
31            rating,
32            date,
33            rd,
34        }
35    }
36}
37
38