#[non_exhaustive]pub enum DataLinkError {
Io(Error),
Encode(EncodeError),
Decode(DecodeError),
ConnectionClosed,
Timeout,
InvalidResponse(&'static str),
MismatchedTransactionId {
expected: u16,
got: u16,
},
ResponseBufferTooSmall {
needed: usize,
available: usize,
},
}Expand description
Errors that can occur during a transport-level operation.
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.
Io(Error)
Underlying I/O error (TCP socket, serial port, etc.).
Encode(EncodeError)
Failed to encode a request frame.
Decode(DecodeError)
Failed to decode a response frame.
ConnectionClosed
The remote peer closed the connection.
Timeout
The request timed out waiting for a response.
InvalidResponse(&'static str)
The response was structurally invalid.
MismatchedTransactionId
The response transaction ID did not match the request.
ResponseBufferTooSmall
The caller-provided response buffer was too small for the response PDU.
Trait Implementations§
Source§impl Debug for DataLinkError
impl Debug for DataLinkError
Source§impl Display for DataLinkError
impl Display for DataLinkError
Source§impl Error for DataLinkError
impl Error for DataLinkError
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<DecodeError> for DataLinkError
impl From<DecodeError> for DataLinkError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<EncodeError> for DataLinkError
impl From<EncodeError> for DataLinkError
Source§fn from(source: EncodeError) -> Self
fn from(source: EncodeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DataLinkError
impl !RefUnwindSafe for DataLinkError
impl Send for DataLinkError
impl Sync for DataLinkError
impl Unpin for DataLinkError
impl UnsafeUnpin for DataLinkError
impl !UnwindSafe for DataLinkError
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