space_traders/models/
ship_fuel.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// Details of the ship's fuel tanks including how much fuel was consumed during the last transit or action.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ShipFuel {
10    /// The current amount of fuel in the ship's tanks.
11    #[serde(rename = "current")]
12    pub current: u32,
13    /// The maximum amount of fuel the ship's tanks can hold.
14    #[serde(rename = "capacity")]
15    pub capacity: u32,
16    #[serde(rename = "consumed", skip_serializing_if = "Option::is_none")]
17    pub consumed: Option<crate::models::ShipFuelConsumed>,
18}
19
20impl ShipFuel {
21    /// Create value with optional fields set to `None`.
22    #[allow(clippy::too_many_arguments)]
23    pub fn new(current: u32, capacity: u32) -> ShipFuel {
24        ShipFuel {
25            current,
26            capacity,
27            consumed: None,
28        }
29    }
30}