pub enum TuyaError {
Show 16 variants
Io {
kind: ErrorKind,
message: String,
},
Json(String),
DecryptionFailed,
EncryptionFailed,
InvalidPayload,
Timeout,
CrcMismatch,
HmacMismatch,
ConnectionFailed,
InvalidHeader,
DecodeError(String),
Offline,
HandshakeFailed,
KeyOrVersionError,
DeviceNotFound(String),
BroadcastLagged {
skipped: u64,
},
}Variants§
Io
Json(String)
DecryptionFailed
EncryptionFailed
InvalidPayload
Timeout
CrcMismatch
HmacMismatch
ConnectionFailed
InvalidHeader
DecodeError(String)
Offline
HandshakeFailed
KeyOrVersionError
DeviceNotFound(String)
BroadcastLagged
The broadcast bus skipped messages because the consumer fell behind by
more than the bus capacity (currently 128 messages). The skipped
messages are permanently lost; the caller should re-query device state
or accept the gap. Surfaced by Device::receive and by the synthetic
listener_lagged event emitted by Device::listener.
Implementations§
Source§impl TuyaError
impl TuyaError
Sourcepub fn io<S: Into<String>>(kind: ErrorKind, message: S) -> Self
pub fn io<S: Into<String>>(kind: ErrorKind, message: S) -> Self
Builds an Io error with the given kind and message.
Sourcepub fn io_other<S: Into<String>>(message: S) -> Self
pub fn io_other<S: Into<String>>(message: S) -> Self
Builds an Io error with ErrorKind::Other and the given message.
Sourcepub fn io_kind(&self) -> Option<ErrorKind>
pub fn io_kind(&self) -> Option<ErrorKind>
Returns the underlying io::ErrorKind if this is an Io error.
pub fn code(&self) -> u32
pub fn from_code(code: u32) -> Self
Trait Implementations§
Source§impl Error for TuyaError
impl Error for TuyaError
1.30.0 · 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 TuyaError
impl RefUnwindSafe for TuyaError
impl Send for TuyaError
impl Sync for TuyaError
impl Unpin for TuyaError
impl UnsafeUnpin for TuyaError
impl UnwindSafe for TuyaError
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