pub struct AnyConnectionError {
message: String,
cause: ErrorCause,
}Expand description
Error returned by AnyConnection::connect, AnyConnection::recv_response
and the rest of this facade.
Renders as the draft-specific error it came from, so nothing that read the
message reads anything different. What is new beside it is
Self::cause — the same failure as a value, so a caller can ask which
kind of failure it was without branching on draft and without parsing the
sentence. See ErrorCause for why the sentence was not enough.
Fields§
§message: String§cause: ErrorCauseImplementations§
Source§impl AnyConnectionError
impl AnyConnectionError
Sourcepub fn facade(message: impl Into<String>) -> Self
pub fn facade(message: impl Into<String>) -> Self
A refusal by this facade itself: nothing was written, nothing reached
the wire. ErrorCause::Facade.
Sourcepub fn cause(&self) -> &ErrorCause
pub fn cause(&self) -> &ErrorCause
What stopped the call, as a value.
Sourcepub fn is_local(&self) -> bool
pub fn is_local(&self) -> bool
Whether the failure was on this side rather than the peer’s.
True for a decode this build would not complete, a message that did not
fit the state machine this side drives, and a call this facade refused
before writing anything. False for every way a peer can end a stream or
a session — which is what an unimplemented message type or an unwelcome
parameter looks like from here — and false for
ErrorCause::PeerViolation, which is the peer’s doing by definition.
ErrorCause::Endpoint answers true, and it is a narrow claim: the
peer’s half of the endpoint’s error type leaves through
ErrorCause::PeerViolation before it gets here. What reaches this
answer is this endpoint refusing on the way out, plus the variants
raised on both paths that no table can tell apart. Those answer true
because that is the safe direction, not because they have been shown to
be this side’s.
ErrorCause::Unclassified answers false, which is the safe direction:
a failure that has not been classified is not evidence of anything.
Trait Implementations§
Source§impl Clone for AnyConnectionError
impl Clone for AnyConnectionError
Source§impl Debug for AnyConnectionError
impl Debug for AnyConnectionError
Source§impl Display for AnyConnectionError
impl Display for AnyConnectionError
impl Eq for AnyConnectionError
Source§impl Error for AnyConnectionError
impl Error for AnyConnectionError
1.30.0 · 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()
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft07 only.
impl From<ConnectionError> for AnyConnectionError
draft07 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft08 only.
impl From<ConnectionError> for AnyConnectionError
draft08 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft09 only.
impl From<ConnectionError> for AnyConnectionError
draft09 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft10 only.
impl From<ConnectionError> for AnyConnectionError
draft10 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft11 only.
impl From<ConnectionError> for AnyConnectionError
draft11 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft12 only.
impl From<ConnectionError> for AnyConnectionError
draft12 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft13 only.
impl From<ConnectionError> for AnyConnectionError
draft13 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft14 only.
impl From<ConnectionError> for AnyConnectionError
draft14 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft15 only.
impl From<ConnectionError> for AnyConnectionError
draft15 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft16 only.
impl From<ConnectionError> for AnyConnectionError
draft16 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft17 only.
impl From<ConnectionError> for AnyConnectionError
draft17 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft18 only.
impl From<ConnectionError> for AnyConnectionError
draft18 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft19 only.
impl From<ConnectionError> for AnyConnectionError
draft19 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft20 only.
impl From<ConnectionError> for AnyConnectionError
draft20 only.Source§fn from(err: ConnectionError) -> Self
fn from(err: ConnectionError) -> Self
Source§impl From<ConnectionError> for AnyConnectionError
Available on crate feature draft21 only.
impl From<ConnectionError> for AnyConnectionError
draft21 only.