pub struct Humidity { /* private fields */ }
Expand description
Absolute humidity in g/m³.
Internally this is represented as a 8.8bit fixed-point number.
To construct a Humidity
instance, either use the lossless new()
constructor, or the lossy from_f32()
method.
Implementations§
source§impl Humidity
impl Humidity
sourcepub fn new(integer: u8, fractional: u8) -> Result<Self, HumidityError>
pub fn new(integer: u8, fractional: u8) -> Result<Self, HumidityError>
Create a new Humidity
instance.
The humidity should be passed in as a 8.8bit fixed-point number.
Examples:
- The pair
(0x00, 0x01)
represents1/256 g/m³
(0.00390625) - The pair
(0xFF, 0xFF)
represents255 g/m³ + 255/256 g/m³
(255.99609375) - The pair
(0x10, 0x80)
represents16 g/m³ + 128/256 g/m³
(16.5)
Trait Implementations§
source§impl PartialEq for Humidity
impl PartialEq for Humidity
impl Eq for Humidity
impl StructuralEq for Humidity
impl StructuralPartialEq for Humidity
Auto Trait Implementations§
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