#[non_exhaustive]pub enum ConnectError {
Service(ServiceError),
HostIdentity(HostIdentityError),
}Expand description
Why Client::connect_expecting did not return a client.
The two variants are different facts. ConnectError::Service is the ordinary connection
story (no record, host unreachable, protocol mismatch, hello refused, timeout) and keeps its
retryable flag. ConnectError::HostIdentity means something answered at the endpoint and
the OS says it is not the host the caller named; no application byte was sent to it.
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.
Service(ServiceError)
HostIdentity(HostIdentityError)
Implementations§
Source§impl ConnectError
impl ConnectError
Sourcepub fn into_service_error(self) -> ServiceError
pub fn into_service_error(self) -> ServiceError
Collapse into the single wire-style error. A host identity refusal becomes code
ERROR_HOST_IDENTITY, not retryable, with the typed detail in the message.
Trait Implementations§
Source§impl Clone for ConnectError
impl Clone for ConnectError
Source§impl Debug for ConnectError
impl Debug for ConnectError
Source§impl Display for ConnectError
impl Display for ConnectError
impl Eq for ConnectError
Source§impl Error for ConnectError
impl Error for ConnectError
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<HostIdentityError> for ConnectError
impl From<HostIdentityError> for ConnectError
Source§fn from(e: HostIdentityError) -> Self
fn from(e: HostIdentityError) -> Self
Converts to this type from the input type.
Source§impl From<ServiceError> for ConnectError
impl From<ServiceError> for ConnectError
Source§fn from(e: ServiceError) -> Self
fn from(e: ServiceError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ConnectError
impl PartialEq for ConnectError
impl StructuralPartialEq for ConnectError
Auto Trait Implementations§
impl Freeze for ConnectError
impl RefUnwindSafe for ConnectError
impl Send for ConnectError
impl Sync for ConnectError
impl Unpin for ConnectError
impl UnsafeUnpin for ConnectError
impl UnwindSafe for ConnectError
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