pub enum DhtError {
ChecksumError(String, u8, u8),
Timeout(String),
TemperatureOutOfRange(String, f32, f32, f32),
HumidityOutOfRange(String, f32, f32, f32),
GpioHandleNotProvided(String),
IncorrectPlatform(String),
FailedAfterRetries {
location: String,
retry_counter: u64,
source: Box<DhtError>,
},
}Expand description
Enum codifies the errors the program may encounter in communication with DHT sensor.
Variants§
ChecksumError(String, u8, u8)
calculated checksum does not match the received value
Timeout(String)
timeout during transmission of data
TemperatureOutOfRange(String, f32, f32, f32)
the temperature value is out of range
HumidityOutOfRange(String, f32, f32, f32)
humidity value is out of range
GpioHandleNotProvided(String)
reported from low-level reading when called without gpio lib handle available
IncorrectPlatform(String)
reported from low-level reading function substitute for non-target platform
FailedAfterRetries
The measurement has been repeated several times without success.
Trait Implementations§
Source§impl Error for DhtError
impl Error for DhtError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for DhtError
impl RefUnwindSafe for DhtError
impl Send for DhtError
impl Sync for DhtError
impl Unpin for DhtError
impl UnwindSafe for DhtError
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