dht22_sensor/error.rs
1/// Possible errors from the DHT22 driver.
2#[derive(Debug, PartialEq, Eq)]
3pub enum DhtError<E> {
4 /// Timed out waiting for a pin state change.
5 Timeout,
6 /// Checksum did not match the received data.
7 ChecksumMismatch,
8 /// Error from the GPIO pin (input/output).
9 PinError(E),
10}
11
12impl<E> From<E> for DhtError<E> {
13 fn from(value: E) -> Self {
14 Self::PinError(value)
15 }
16}