pub struct Pressure(pub u32);Expand description
Represents atmospheric pressure in Pascal (Pa).
§Example
A value of 101325 represents 101325 Pa (or 1013.25 hPa).
Tuple Fields§
§0: u32Implementations§
Source§impl Pressure
impl Pressure
Sourcepub fn as_hpa(&self) -> (u32, u32)
pub fn as_hpa(&self) -> (u32, u32)
Converts the raw Pascal value to Hectopascal (hPa) and splits it into parts.
Since 1 hPa = 100 Pa, this effectively splits the integer at the hundreds place.
§Returns
A tuple (hPa_integral, hPa_decimal).
§Example
use bme680_driver::Pressure;
let press = Pressure(101325);
assert_eq!(press.as_hpa(), (1013, 25)); // Represents 1013.25 hPaTrait Implementations§
impl Copy for Pressure
Auto Trait Implementations§
impl Freeze for Pressure
impl RefUnwindSafe for Pressure
impl Send for Pressure
impl Sync for Pressure
impl Unpin for Pressure
impl UnwindSafe for Pressure
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more