#[non_exhaustive]pub enum Error {
Transport(Error),
Build(BuildError),
NoResponse,
CredentialsRequired,
AuthenticationFailed,
FlowRebound {
previous: SocketAddr,
current: SocketAddr,
},
TooManyFlows,
PushNotSupported {
reason: String,
},
Rejected {
status: u16,
reason: String,
},
}Expand description
What can go wrong in the user agent.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transport(Error)
The transport failed.
Build(BuildError)
A message could not be built.
NoResponse
The transaction ended without a final response — a timeout or a transport failure.
CredentialsRequired
The server challenged and no credentials were configured.
AuthenticationFailed
The server challenged again after credentials were supplied, and did not say the nonce was stale. Retrying would be guessing at a password.
FlowRebound
The flow’s reflexive address changed, so the flow has failed (RFC 5626 §4.4.2).
Not a transport error: the socket works. The NAT rebound, so the mapping the registrar holds for this flow no longer reaches it, and §4.4.2 requires the UA to treat that as a failure and re-establish rather than carry on pinging an address nothing routes to.
Fields
previous: SocketAddrThe address the previous keep-alive reported.
current: SocketAddrThe address this one did.
TooManyFlows
More flows were added than reg-id can number (RFC 5626 §4.2 caps it at 2^31 - 1).
PushNotSupported
The registrar answered 555: it does not support the push notification service the
Contact named (RFC 8599 §8.1).
Distinct from Error::Rejected because retrying cannot help. Every attempt naming this
push service will be refused the same way, and a client that treats it as a transient
failure stays unreachable while looking busy.
Rejected
The server refused.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more