pub struct Humidity(/* private fields */);Expand description
A humidity reading
Implementations§
Source§impl Humidity
impl Humidity
Sourcepub fn as_raw(&self) -> u16
pub fn as_raw(&self) -> u16
Returns the humidity reading exactly as read from the sensor, with the status bits cleared
Sourcepub fn as_percent_relative(&self) -> f32
pub fn as_percent_relative(&self) -> f32
Converts the temperature reading into percent relative humidity (0.0 = 0%, 100.0 = 100%) and clamps it to the 0%-100% range
This function uses single-precision floating-point operations.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Humidity
impl RefUnwindSafe for Humidity
impl Send for Humidity
impl Sync for Humidity
impl Unpin for Humidity
impl UnwindSafe for Humidity
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