Skip to main content

ConnectionError

Enum ConnectionError 

Source
pub enum ConnectionError {
    Endpoint(EndpointError),
    Codec(CodecError),
    Transport(TransportError),
    VarInt(VarIntError),
    NoControlStream,
    UnexpectedEnd,
    StreamFinished,
    InvalidAddress(String),
    TlsConfig(String),
    DataStreamState(&'static str),
    ExtensionsOnNonNormalStatus {
        object_id: u64,
        extensions_len: usize,
        status: ObjectStatus,
    },
}
Expand description

Errors from the connection layer.

Variants§

§

Endpoint(EndpointError)

Endpoint state machine error.

§

Codec(CodecError)

Wire codec error.

§

Transport(TransportError)

Transport-level error.

§

VarInt(VarIntError)

Variable-length integer decoding error.

§

NoControlStream

Control stream was not opened.

§

UnexpectedEnd

Stream ended before a complete message was read.

§

StreamFinished

Stream was finished by the peer.

§

InvalidAddress(String)

Invalid server address string.

§

TlsConfig(String)

TLS configuration error.

§

DataStreamState(&'static str)

Data stream used out of order (e.g. object before header).

§

ExtensionsOnNonNormalStatus

An Object arrived carrying extension headers on a status that is not Normal.

Draft-15 Section 10.2.1.2: “Any Object with status Normal can have extension headers. If an endpoint receives extension headers on Objects with status that is not Normal, it MUST close the session with a PROTOCOL_VIOLATION.”

The codec decodes such an Object rather than refusing it — the frame is well formed, and a tool that reports non-conforming traffic has to be able to read it. Being an endpoint rather than an observer is what turns it into an error, so it is raised here, on the receive path, and not in the decoder.

Connection::close_for_data_stream performs the close the sentence above requires. It is a separate call because the reader that raises this holds no connection, and because a deliberately permissive caller should be able to read a violating stream and report it without tearing the session down.

Fields

§object_id: u64

The Object ID the extension headers arrived on.

§extensions_len: usize

Length in bytes of the extension-header block.

§status: ObjectStatus

The Object’s status, resolved through the encoding’s elision rule.

Spelled out in full because the glob import of moqtap_codec::types brings a different ObjectStatus into this module.

Trait Implementations§

Source§

impl Debug for ConnectionError

Source§

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

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

impl Display for ConnectionError

Source§

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

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

impl Error for ConnectionError

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<CodecError> for ConnectionError

Source§

fn from(source: CodecError) -> Self

Converts to this type from the input type.
Source§

impl From<DialError> for ConnectionError

Source§

fn from(e: DialError) -> Self

Preserves the variants this error had when the dial was inlined here, so a caller matching on InvalidAddress or TlsConfig sees no change.

Source§

impl From<EndpointError> for ConnectionError

Source§

fn from(source: EndpointError) -> Self

Converts to this type from the input type.
Source§

impl From<TransportError> for ConnectionError

Source§

fn from(source: TransportError) -> Self

Converts to this type from the input type.
Source§

impl From<VarIntError> for ConnectionError

Source§

fn from(source: VarIntError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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