aboutsummaryrefslogtreecommitdiffstats
path: root/src/temperature.rs
diff options
context:
space:
mode:
authorsam-anthony <samanthony6@protonmail.com>2022-01-15 20:31:04 -0330
committersam-anthony <samanthony6@protonmail.com>2022-01-15 20:31:04 -0330
commitef3980225a0a0ed5bea0d748709c1f227e33c851 (patch)
treeeafe6e82c02224ea62b5c7acdf75ae2fd93f2187 /src/temperature.rs
downloadvolute-ef3980225a0a0ed5bea0d748709c1f227e33c851.zip
units of measurement
Diffstat (limited to 'src/temperature.rs')
-rw-r--r--src/temperature.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/temperature.rs b/src/temperature.rs
new file mode 100644
index 0000000..2eac48d
--- /dev/null
+++ b/src/temperature.rs
@@ -0,0 +1,11 @@
+pub struct Temperature(f64); // Base unit is kelvin
+
+impl Temperature {
+ pub fn from_kelvin(kelvin: f64) -> Temperature {
+ Temperature(kelvin)
+ }
+
+ pub fn as_kelvin(&self) -> f64 {
+ self.0
+ }
+}