pub enum ObnizError {
Connection(String),
WebSocket(String),
IoOperation(String),
InvalidPin(u8),
JsonParse(String),
Timeout,
CallbackError(String),
DeviceNotFound(String),
PermissionDenied,
Generic(String),
}Expand description
Custom error types for the obniz library
Variants§
Connection(String)
Connection errors
WebSocket(String)
WebSocket communication errors
IoOperation(String)
IO operation errors
InvalidPin(u8)
Invalid pin number (valid range: 0-11)
JsonParse(String)
JSON parsing errors
Timeout
Response timeout
CallbackError(String)
Callback registration errors
DeviceNotFound(String)
Device not found or invalid device ID
PermissionDenied
Permission denied
Generic(String)
Generic error with message
Trait Implementations§
Source§impl Debug for ObnizError
impl Debug for ObnizError
Source§impl Display for ObnizError
impl Display for ObnizError
Source§impl Error for ObnizError
impl Error for ObnizError
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()
Source§impl From<Error> for ObnizError
impl From<Error> for ObnizError
Source§impl From<Error> for ObnizError
impl From<Error> for ObnizError
Source§impl From<Error> for ObnizError
impl From<Error> for ObnizError
Source§impl From<RecvError> for ObnizError
impl From<RecvError> for ObnizError
Source§impl From<SendError<ObnizCommand>> for ObnizError
impl From<SendError<ObnizCommand>> for ObnizError
Source§fn from(err: SendError<ObnizCommand>) -> Self
fn from(err: SendError<ObnizCommand>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ObnizError
impl RefUnwindSafe for ObnizError
impl Send for ObnizError
impl Sync for ObnizError
impl Unpin for ObnizError
impl UnsafeUnpin for ObnizError
impl UnwindSafe for ObnizError
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