pub enum RelayError {
IrrelevantCommand(String, InternalCommand),
FailureCommandMessageCreation(String),
WriteError(String),
ReadError(String),
IncorrectChecksum(String),
PulseNotAllowedForDevice(String, AquariumDevice),
ActuationFailed {
location: String,
actuation_name: String,
last_attempt_number: u64,
max_attempt_allowed: u64,
source: Box<RelayError>,
},
InitialValue(String),
SerialPortNotConfigured(String),
SendToSerialPortFailed {
location: String,
source: Error,
},
SerialPortFlushFailed {
location: String,
source: Error,
},
}Expand description
Enum codifies the errors which the program may encounter in preparation or execution of communication with the relay manager
Variants§
IrrelevantCommand(String, InternalCommand)
Received an irrelevant command.
FailureCommandMessageCreation(String)
Failure occurred in command message creation.
WriteError(String)
Error occurred when writing to relay.
ReadError(String)
Error occurred when reading relay state.
IncorrectChecksum(String)
Encountered an incorrect checksum in communication with relay provider.
PulseNotAllowedForDevice(String, AquariumDevice)
The pulse-command is not allowed for the device.
ActuationFailed
The actuation failed after several retries.
Fields
§
source: Box<RelayError>InitialValue(String)
Used to initialize variable. Value is overwritten with real error.
SerialPortNotConfigured(String)
Serial port has not been initialized. This is a configuration error.
SendToSerialPortFailed
Sending to the serial port failed
SerialPortFlushFailed
Flushing the serial port buffer failed.
Trait Implementations§
Source§impl Debug for RelayError
impl Debug for RelayError
Source§impl Display for RelayError
impl Display for RelayError
Source§impl Error for RelayError
impl Error for RelayError
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 RelayError
impl !RefUnwindSafe for RelayError
impl Send for RelayError
impl Sync for RelayError
impl Unpin for RelayError
impl !UnwindSafe for RelayError
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