pub enum ExceptionCode {
IllegalFunction,
IllegalDataAddress,
IllegalDataValue,
ServerDeviceFailure,
Acknowledge,
ServerDeviceBusy,
MemoryParityError,
GatewayPathUnavailable,
GatewayTargetDevice,
Custom(u8),
}
Expand description
A server (slave) exception.
Variants§
IllegalFunction
0x01
IllegalDataAddress
0x02
IllegalDataValue
0x03
ServerDeviceFailure
0x04
Acknowledge
0x05
ServerDeviceBusy
0x06
MemoryParityError
0x08
0x0A
GatewayTargetDevice
0x0B
Custom(u8)
None of the above.
Although encoding one of the predefined values as this is possible, it is not recommended.
Instead, prefer to use Self::new()
to prevent such ambiguities.
Implementations§
Source§impl ExceptionCode
impl ExceptionCode
Sourcepub const fn new(value: u8) -> Self
pub const fn new(value: u8) -> Self
Create a new ExceptionCode
with value
.
Trait Implementations§
Source§impl Clone for ExceptionCode
impl Clone for ExceptionCode
Source§fn clone(&self) -> ExceptionCode
fn clone(&self) -> ExceptionCode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ExceptionCode
impl Debug for ExceptionCode
Source§impl Display for ExceptionCode
impl Display for ExceptionCode
Source§impl Error for ExceptionCode
impl Error for ExceptionCode
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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
Source§impl From<ExceptionCode> for u8
impl From<ExceptionCode> for u8
Source§fn from(from: ExceptionCode) -> Self
fn from(from: ExceptionCode) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ExceptionCode
impl PartialEq for ExceptionCode
impl Copy for ExceptionCode
impl Eq for ExceptionCode
impl StructuralPartialEq for ExceptionCode
Auto Trait Implementations§
impl Freeze for ExceptionCode
impl RefUnwindSafe for ExceptionCode
impl Send for ExceptionCode
impl Sync for ExceptionCode
impl Unpin for ExceptionCode
impl UnwindSafe for ExceptionCode
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