pub enum ConnectError {
Unsupported {
kind: TransportKind,
reason: &'static str,
},
Spec(SpecError),
Config(ClientError),
Versions(SupportedVersionsError),
Handshake(HandshakeError),
NoCommonVersion(NegotiationError),
HttpEndpoint(HttpClientError),
LegacySse(LegacySseError),
}Expand description
Why a session could not be opened.
Collapses five failure sources into one so a caller can handle “could not connect” as one arm, and read which of the four stages failed by matching the variant. The inner errors are kept rather than flattened to strings, because a caller retrying on a transient transport fault needs to tell that apart from a server that will never speak a common revision.
Variants§
Unsupported
The spec names a transport this crate has no client adapter for.
A refusal rather than a half-open connection: a caller told only that connecting failed cannot tell “wrong URL” from “this build has no such adapter”, and retries the first forever.
Fields
kind: TransportKindThe transport that was asked for.
Spec(SpecError)
The spec itself was unusable.
Config(ClientError)
The offered revisions were not a usable set.
Versions(SupportedVersionsError)
The default offered revisions could not be built.
Handshake(HandshakeError)
The handshake did not complete.
NoCommonVersion(NegotiationError)
The two sides share no revision.
HttpEndpoint(HttpClientError)
A Streamable HTTP endpoint could not be prepared.
LegacySse(LegacySseError)
A legacy HTTP+SSE endpoint could not be opened.
Trait Implementations§
Source§impl Debug for ConnectError
impl Debug for ConnectError
Source§impl Display for ConnectError
impl Display 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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()