pub struct Co2Correction {
pub result: Option<u16>,
}Expand description
Result of a forced CO₂ recalibration (FRC).
Fields§
§result: Option<u16>Raw FRC result word, or None if the recalibration failed (0xFFFF).
Prefer Co2Correction::value, which decodes this into a correction in ppm.
Implementations§
Source§impl Co2Correction
impl Co2Correction
Sourcepub fn value(&self) -> Option<Ppm>
pub fn value(&self) -> Option<Ppm>
The applied CO₂ correction, in ppm, or None if the recalibration failed.
The raw result is offset-encoded around 0x8000; this subtracts the offset.
use sen6x::types::Co2Correction;
// 0x8000 encodes a zero correction.
let c = Co2Correction { result: Some(0x8000) };
assert_eq!(f32::from(c.value().unwrap()), 0.0);Trait Implementations§
Source§impl Clone for Co2Correction
impl Clone for Co2Correction
Source§fn clone(&self) -> Co2Correction
fn clone(&self) -> Co2Correction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Co2Correction
impl Debug for Co2Correction
Source§impl<'de> Deserialize<'de> for Co2Correction
impl<'de> Deserialize<'de> for Co2Correction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Co2Correction
Source§impl PartialEq for Co2Correction
impl PartialEq for Co2Correction
Source§fn eq(&self, other: &Co2Correction) -> bool
fn eq(&self, other: &Co2Correction) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Co2Correction
impl Serialize for Co2Correction
impl StructuralPartialEq for Co2Correction
Auto Trait Implementations§
impl Freeze for Co2Correction
impl RefUnwindSafe for Co2Correction
impl Send for Co2Correction
impl Sync for Co2Correction
impl Unpin for Co2Correction
impl UnsafeUnpin for Co2Correction
impl UnwindSafe for Co2Correction
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