#[non_exhaustive]pub enum Error {
Show 25 variants
InvalidConfig {
field: &'static str,
reason: &'static str,
},
InvalidCancellation {
reason: &'static str,
},
TransportNotConfigured {
transport: &'static str,
},
Io(Error),
EndpointClosed,
EndpointDraining,
RuntimeUnavailable,
Overloaded {
peer: SocketAddr,
},
PolicyRejected {
reason: String,
},
ProtectedPolicyHeader {
name: String,
},
SourceAdmissionCapacity {
max: usize,
attempted: usize,
},
NoVia,
Build(BuildError),
Tls(TlsError),
Quic(QuicError),
NoTransaction,
KeepaliveRefused,
KeepaliveUnanswered,
ConnectionClosed,
Unresolvable(Vec<u8>),
UnsupportedTransport(&'static str),
ConnectionCapacity {
max: usize,
},
Capture {
path: String,
source: Error,
},
TcpFallbackUnavailable {
size: usize,
limit: usize,
source: Box<Error>,
},
TooLarge {
size: usize,
limit: usize,
},
}Expand description
What can go wrong in the transport layer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidConfig
Endpoint configuration cannot create a bounded, live runtime.
Fields
InvalidCancellation
An outgoing transaction cannot be cancelled as requested.
TransportNotConfigured
An outbound request selected a listener kind this endpoint did not configure.
Io(Error)
A socket operation failed.
EndpointClosed
The endpoint loop has stopped.
EndpointDraining
Graceful drain has closed admission for requests which establish a dialog.
An in-process endpoint was constructed without an entered Tokio runtime.
Overloaded
The next hop asked this endpoint to reduce traffic and this request was not admitted.
Fields
peer: SocketAddrThe downstream server whose active report caused the rejection.
PolicyRejected
A configured pre-transaction policy refused the request.
ProtectedPolicyHeader
A policy attempted to add a stack-owned identity, routing, authentication or framing field.
SourceAdmissionCapacity
A live source-admission replacement exceeded the configured scan bound.
Fields
NoVia
A request could not be sent because it has no usable Via, so no transaction could be
keyed on it and no response could ever be matched.
Build(BuildError)
A message could not be built.
Tls(TlsError)
TLS could not be established or verified.
A sips: request that reaches this has failed. There is deliberately no path from here
to a cleartext retry: a downgrade would defeat exactly what the scheme asked for.
Quic(QuicError)
QUIC authentication, negotiation, or connection failure.
NoTransaction
A response was given for a transaction that no longer exists.
Almost always means the application took longer to answer than
crate::Config::unanswered_limit allows. Reported rather than swallowed: an
application told its 200 OK went out, when it did not, believes a call is up while the
caller has already timed out.
KeepaliveRefused
A keep-alive was answered with a STUN Binding Error Response (RFC 5626 §4.4.2).
§4.4.2 says the flow “is considered failed” — a refused keep-alive is a stronger signal than an unanswered one, since something is there and it does not want this flow.
KeepaliveUnanswered
A keep-alive went unanswered (RFC 5626 §4.4.1, §4.4.2).
§4.4.1: “If a pong is not received within 10 seconds after sending a ping … then the client MUST treat the flow as failed.”
ConnectionClosed
The connection a keep-alive was sent on closed before it was answered.
Unresolvable(Vec<u8>)
A URI that resolved to no usable candidate (RFC 3263).
UnsupportedTransport(&'static str)
A transport that is declared but not yet implemented.
ConnectionCapacity
Every configured live connection slot is still occupied.
Capture
A capture file could not be opened (docs/specs/sip-transport.md §13).
Reported from bind rather than swallowed, because the alternative is an endpoint that
starts, appears to be recording, and writes nothing — the same failure as a silent discard,
one level up. The path is named because a permission or directory mistake is the usual cause.
An oversized UDP request selected the mandatory TCP fallback, but TCP could not be used.
The concrete cause is retained so connection refusal, capacity and endpoint shutdown stay distinguishable. There is deliberately no retry over UDP after this error.
TooLarge
A datagram larger than the path MTU on an unreliable transport (RFC 3261 §18.1.1).
Named rather than truncated: a truncated SIP message is a security problem, not a degraded one.
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