Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 29 variants Transport(String), Decode(DecodeError), Version, RequiredExtension, UnexpectedStream, BoundsExceeded(BoundsExceeded), Duplicate, Cancel, Timeout, Old, App(u16), NotFound, Unroutable, WrongSize, ProtocolViolation, Unauthorized, UnexpectedMessage, Unsupported, Encode(EncodeError), TooManyParameters, InvalidRole, UnknownAlpn(String), Dropped, Closed, Lagged, FrameTooLarge, TimestampMismatch, Evicted, Remote(u32),
}
Expand description

A list of possible errors that can occur during the session.

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

Transport(String)

The underlying QUIC/WebTransport connection failed; carries the backend’s message.

§

Decode(DecodeError)

A message off the wire could not be parsed.

§

Version

Version negotiation failed, or the negotiated version lacks a requested feature (e.g. a FETCH against a version without fetch support). Mostly a connect-time error, but the feature-gap case can surface mid-session, so it can’t simply move to a connect-only error type.

§

RequiredExtension

A required extension was not present

§

UnexpectedStream

An unexpected stream type was received

§

BoundsExceeded(BoundsExceeded)

An integer was too large for the QUIC varint range.

§

Duplicate

A duplicate ID was used

§

Cancel

Nobody is reading any more, so the producer stopped. Not a failure.

§

Timeout

It took too long to open or transmit a stream.

§

Old

The group is older than the latest group and dropped.

§

App(u16)

An application-chosen close code. Bounded to u16 and offset past the library’s reserved range (+ 64) on the wire by Self::to_code, so app codes never collide with protocol ones.

The width asymmetry with Self::Remote is deliberate: App is a code this side chooses to send, while Remote carries a raw code received off the wire that didn’t map to a known variant, which can be any u32.

§

NotFound

The requested broadcast or track does not exist at the peer.

§

Unroutable

A broadcast was requested that is neither announced nor served by a dynamic router, so there is no route to it.

§

WrongSize

A frame’s payload length disagreed with its declared size.

§

ProtocolViolation

The peer broke a protocol rule; the session is unusable.

§

Unauthorized

The peer’s token does not grant the requested path or operation.

§

UnexpectedMessage

A valid message arrived in a state where it is not allowed.

§

Unsupported

The peer asked for a feature this endpoint does not implement.

§

Encode(EncodeError)

A message could not be serialized for the negotiated version.

§

TooManyParameters

A message carried more parameters than this endpoint accepts.

§

InvalidRole

The peer acted against the Role it advertised at SETUP.

§

UnknownAlpn(String)

The peer offered an ALPN this endpoint doesn’t recognize, so no version could be negotiated. A connect-time error.

§

Dropped

The producer was dropped without finishing, so the content is incomplete.

§

Closed

The handle was already closed by this side.

§

Lagged

The reader fell behind the group’s byte budget: the frame it wanted was dropped to keep the group under its size limit. Named from the consumer’s side (nothing is “full”); distinct from Self::Evicted, which drops a whole group under the pool’s memory pressure.

§

FrameTooLarge

A frame declared a payload size larger than the receiver accepts.

§

TimestampMismatch

A frame’s timestamp doesn’t match its track’s negotiated timescale: it’s missing on a timed track, present on an untimed track, or carries a different scale than the track advertised.

§

Evicted

The group was evicted from the cache under memory pressure (see cache::Pool). Unlike Self::Old, the group was still within the publisher’s window; it can be re-fetched.

§

Remote(u32)

A remote error received via a stream/session reset code.

Implementations§

Source§

impl Error

Source

pub fn to_code(&self) -> u32

An integer code that is sent over the wire.

Source

pub fn from_transport(err: impl Error) -> Self

Convert a transport error into an Error, decoding stream reset codes.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
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 Error for Error

Source§

fn session_error(&self) -> Option<(u32, String)>

Returns the error code and reason if this was an application error. Read more
Source§

fn stream_error(&self) -> Option<u32>

Returns the error code if this was a stream error.
Source§

impl From<BoundsExceeded> for Error

Source§

fn from(source: BoundsExceeded) -> Self

Converts to this type from the input type.
Source§

impl From<DecodeError> for Error

Source§

fn from(source: DecodeError) -> Self

Converts to this type from the input type.
Source§

impl From<EncodeError> for Error

Source§

fn from(source: EncodeError) -> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,

Source§

impl<T> MaybeSync for T
where T: Sync,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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