#[non_exhaustive]pub enum Error {
OutOfRange {
expected: Range<usize>,
got: usize,
quantity: &'static str,
},
InvalidValueForType {
ty: &'static str,
value: String,
},
InvalidData,
Timeout,
Abort,
NoLogicalAddress,
Disconnected,
Unsupported,
SystemError(Errno),
TxError(TxError),
RxError(RxError),
UnknownError(String),
}Expand description
A set of common errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
OutOfRange
A value of a given quantity was outside of the expected range.
InvalidValueForType
Got a value for a given type that was invalid for that ty.
InvalidData
Got generic invalid data.
Timeout
A timeout occurred.
Abort
A request was aborted.
NoLogicalAddress
The request failed because the device doesn’t have a logical address.
Disconnected
The device was disconnected from the system.
Unsupported
An unsupported operation was attempted on this device.
SystemError(Errno)
A generic system error occurred.
TxError(TxError)
Got an error while transmitting a Message
that did not correspond to one of the other error types.
RxError(RxError)
Got an error while receiving a Message
that did not correspond to one of the other error types.
UnknownError(String)
Got an error that does not map to any of the other error types.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<CEC_TX_STATUS> for Error
impl From<CEC_TX_STATUS> for Error
Source§fn from(tx_status: CEC_TX_STATUS) -> Error
fn from(tx_status: CEC_TX_STATUS) -> Error
Converts to this type from the input type.
Source§impl<T: TryFromPrimitive> From<TryFromPrimitiveError<T>> for Error
impl<T: TryFromPrimitive> From<TryFromPrimitiveError<T>> for Error
Source§fn from(val: TryFromPrimitiveError<T>) -> Error
fn from(val: TryFromPrimitiveError<T>) -> Error
Converts to this type from the input type.
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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