Skip to main content

Error

Enum Error 

Source
#[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
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.
§

InvalidConfig

Endpoint configuration cannot create a bounded, live runtime.

Fields

§field: &'static str

The public configuration field that is invalid.

§reason: &'static str

Its required range.

§

InvalidCancellation

An outgoing transaction cannot be cancelled as requested.

Fields

§reason: &'static str

Which invariant the request did not satisfy.

§

TransportNotConfigured

An outbound request selected a listener kind this endpoint did not configure.

Fields

§transport: &'static str

Stable upper-case transport spelling.

§

Io(Error)

A socket operation failed.

§

EndpointClosed

The endpoint loop has stopped.

§

EndpointDraining

Graceful drain has closed admission for requests which establish a dialog.

§

RuntimeUnavailable

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: SocketAddr

The downstream server whose active report caused the rejection.

§

PolicyRejected

A configured pre-transaction policy refused the request.

Fields

§reason: String

Host-supplied, non-secret reason.

§

ProtectedPolicyHeader

A policy attempted to add a stack-owned identity, routing, authentication or framing field.

Fields

§name: String

Canonical field name.

§

SourceAdmissionCapacity

A live source-admission replacement exceeded the configured scan bound.

Fields

§max: usize

Configured maximum number of prefixes in one generation.

§attempted: usize

Number of prefixes in the refused replacement.

§

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.

Fields

§max: usize

The configured live-task limit.

§

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.

Fields

§path: String

Where the capture was to be written.

§source: Error

Why it could not be.

§

TcpFallbackUnavailable

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.

Fields

§size: usize

Serialized request size that required the switch.

§limit: usize

RFC 3261 §18.1.1’s derived limit for this path.

§source: Box<Error>

Why the selected TCP send failed.

§

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.

Fields

§size: usize

How big the message is.

§limit: usize

The configured limit.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<BuildError> for Error

Source§

fn from(source: BuildError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<QuicError> for Error

Source§

fn from(source: QuicError) -> Self

Converts to this type from the input type.
Source§

impl From<TlsError> for Error

Source§

fn from(source: TlsError) -> Self

Converts to this type from the input type.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,