#[non_exhaustive]pub enum TransportError {
Io {
kind: ErrorKind,
message: String,
},
Tls(String),
InvalidHost(String),
ConnectTimeout(Duration),
WriteTimeout(Duration),
Idle(Duration),
FrameTooLong {
length: usize,
limit: usize,
},
Decode(String),
Closed,
}Expand description
Reasons a connection fails below the level of protocol messages.
The variants carry text instead of the underlying error values so the type stays comparable and cloneable.
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
Reading from or writing to the socket failed.
Fields
Tls(String)
The TLS layer refused the configuration or the handshake.
InvalidHost(String)
The host is not a name a certificate can be checked against.
ConnectTimeout(Duration)
The connection was not established in time.
WriteTimeout(Duration)
A write to the socket did not complete in time.
Idle(Duration)
The peer sent nothing, not even a heartbeat, for the time allowed.
FrameTooLong
A frame is longer than the limit.
Decode(String)
A frame does not hold a valid message.
Closed
The peer closed the connection.
Trait Implementations§
Source§impl Clone for TransportError
impl Clone for TransportError
Source§impl Debug for TransportError
impl Debug for TransportError
Source§impl Display for TransportError
impl Display for TransportError
impl Eq for TransportError
Source§impl Error for TransportError
impl Error for TransportError
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
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<Error> for TransportError
impl From<Error> for TransportError
Source§impl From<TransportError> for ConnectorError
impl From<TransportError> for ConnectorError
Source§fn from(source: TransportError) -> Self
fn from(source: TransportError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TransportError
impl PartialEq for TransportError
impl StructuralPartialEq for TransportError
Auto Trait Implementations§
impl Forget for TransportError
impl Freeze for TransportError
impl Move for TransportError
impl RefUnwindSafe for TransportError
impl Send for TransportError
impl Sync for TransportError
impl Unpin for TransportError
impl UnsafeUnpin for TransportError
impl UnwindSafe for TransportError
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