pitbox/models/
common.rs

1use serde::Deserialize;
2
3// Top level struct that matches the entire JSON response.
4#[derive(Deserialize)]
5pub struct ApiResponse<T> {
6    #[serde(rename = "MRData")]
7    pub mr_data: T,
8}
9
10#[derive(Deserialize)]
11#[allow(dead_code)]
12pub struct Constructor {
13    #[serde(rename = "constructorId")]
14    pub id: String,
15    pub name: String,
16    pub nationality: String,
17}
18
19#[allow(dead_code)]
20#[derive(Deserialize)]
21#[serde(rename_all = "camelCase")]
22pub struct Driver {
23    #[serde(rename = "driverId")]
24    pub id: String,
25    pub permanent_number: Option<String>,
26    pub code: Option<String>,
27    pub given_name: String,
28    pub family_name: String,
29    pub nationality: String,
30}