chemistru_elements/
physical.rs

1#[derive(Clone, Debug, PartialEq, PartialOrd)]
2pub struct PhysicalData {
3    pub(crate) boiling_point: Option<f64>,
4    pub(crate) melting_point: Option<f64>,
5    pub(crate) density: Option<f64>,
6    pub(crate) molar_heat_capacity: Option<f64>,
7    pub(crate) phase_in_standard_conditions: &'static str,
8}
9
10impl PhysicalData {
11    #[must_use]
12    pub const fn density(&self) -> Option<f64> {
13        self.density
14    }
15
16    #[must_use]
17    pub const fn boiling_point(&self) -> Option<f64> {
18        self.boiling_point
19    }
20
21    #[must_use]
22    pub const fn melting_point(&self) -> Option<f64> {
23        self.melting_point
24    }
25
26    #[must_use]
27    pub const fn molar_heat_capacity(&self) -> Option<f64> {
28        self.molar_heat_capacity
29    }
30
31    #[must_use]
32    pub const fn phase_in_standard_conditions(&self) -> &'static str {
33        self.phase_in_standard_conditions
34    }
35
36    #[must_use]
37    pub const fn new(
38        boiling_point: Option<f64>,
39        melting_point: Option<f64>,
40        density: Option<f64>,
41        molar_heat_capacity: Option<f64>,
42        phase_in_standard_conditions: &'static str,
43    ) -> Self {
44        Self {
45            boiling_point,
46            melting_point,
47            density,
48            molar_heat_capacity,
49            phase_in_standard_conditions,
50        }
51    }
52}