aboutsummaryrefslogtreecommitdiffstats
path: root/src/pressure.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/pressure.rs
downloadvolute-ef3980225a0a0ed5bea0d748709c1f227e33c851.zip
units of measurement
Diffstat (limited to 'src/pressure.rs')
-rw-r--r--src/pressure.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pressure.rs b/src/pressure.rs
new file mode 100644
index 0000000..f746186
--- /dev/null
+++ b/src/pressure.rs
@@ -0,0 +1,11 @@
+pub struct Pressure(f64); // Base unit is pascals
+
+impl Pressure {
+ pub fn from_pascals(pascals: f64) -> Self {
+ Self(pascals)
+ }
+
+ pub fn as_pascals(&self) -> f64 {
+ self.0
+ }
+}