pub enum Error {
Transport(TransportError),
Protocol(ProtocolError),
Validation(ValidationError),
RadioError,
NotAvailable,
Timeout(Duration),
NotIdentified,
MemoryWriteProtected {
page: u16,
},
WriteNotAcknowledged {
page: u16,
got: u8,
},
InvalidImageSize {
actual: usize,
expected: usize,
},
}Expand description
Top-level error type for all radio operations.
Variants§
Transport(TransportError)
A transport-layer (serial/Bluetooth) error occurred.
Protocol(ProtocolError)
A protocol-layer error occurred while parsing or encoding a command.
Validation(ValidationError)
A validation error occurred on a user-supplied value.
RadioError
The radio returned an error response (?\r).
NotAvailable
The radio returned “not available” (N\r) — command not supported in current mode.
Timeout(Duration)
A command timed out waiting for a response.
NotIdentified
The radio has not been identified yet; call identify() first.
MemoryWriteProtected
A write was attempted to a protected memory region (factory calibration).
WriteNotAcknowledged
The radio did not ACK a write command.
InvalidImageSize
The supplied memory image has an invalid size.
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<ProtocolError> for Error
impl From<ProtocolError> for Error
Source§fn from(source: ProtocolError) -> Self
fn from(source: ProtocolError) -> Self
Converts to this type from the input type.
Source§impl From<TransportError> for Error
impl From<TransportError> for Error
Source§fn from(source: TransportError) -> Self
fn from(source: TransportError) -> Self
Converts to this type from the input type.
Source§impl From<ValidationError> for Error
impl From<ValidationError> for Error
Source§fn from(source: ValidationError) -> Self
fn from(source: ValidationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin 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