pub struct Error {
    pub code: Code,
    pub frame_type: VarInt,
    pub reason: &'static str,
}
Expand description

Transport Errors are 62-bit unsigned integer values indicating a QUIC transport error has occurred, as defined in QUIC Transport RFC.

Fields§

§code: Code

A 62-bit unsigned integer value indicating the error that occurred

§frame_type: VarInt

If this error was caused by a particular QUIC frame, frame_type will contain the Frame Type as defined in QUIC Transport RFC.

§reason: &'static str

Additional information about the error that occurred

Implementations§

source§

impl Error

source

pub const fn new(code: VarInt) -> Self

Creates a new Error

source

pub const fn with_frame_type(self, frame_type: VarInt) -> Self

Updates the Error with the specified frame_type

source

pub const fn with_reason(self, reason: &'static str) -> Self

Updates the Error with the specified reason

source§

impl Error

source

pub const NO_ERROR: Self = _

An endpoint uses this with CONNECTION_CLOSE to signal that the connection is being closed abruptly in the absence of any error

source

pub const INTERNAL_ERROR: Self = _

The endpoint encountered an internal error and cannot continue with the connection.

source

pub const CONNECTION_REFUSED: Self = _

The server refused to accept a new connection.

source

pub const FLOW_CONTROL_ERROR: Self = _

An endpoint received more data than it permitted in its advertised data limits.

source

pub const STREAM_LIMIT_ERROR: Self = _

An endpoint received a frame for a stream identifier that exceeded its advertised stream limit for the corresponding stream type.

source

pub const STREAM_STATE_ERROR: Self = _

An endpoint received a frame for a stream that was not in a state that permitted that frame.

source

pub const FINAL_SIZE_ERROR: Self = _

An endpoint received a STREAM frame containing data that exceeded the previously established final size.

source

pub const FRAME_ENCODING_ERROR: Self = _

An endpoint received a frame that was badly formatted.

source

pub const TRANSPORT_PARAMETER_ERROR: Self = _

An endpoint received transport parameters that were badly formatted.

source

pub const CONNECTION_ID_LIMIT_ERROR: Self = _

The number of connection IDs provided by the peer exceeds the advertised active_connection_id_limit.

source

pub const PROTOCOL_VIOLATION: Self = _

An endpoint detected an error with protocol compliance that was not covered by more specific error codes.

source

pub const INVALID_TOKEN: Self = _

A server received a client Initial that contained an invalid Token field.

source

pub const APPLICATION_ERROR: Self = _

The application or application protocol caused the connection to be closed.

source

pub const CRYPTO_BUFFER_EXCEEDED: Self = _

An endpoint has received more data in CRYPTO frames than it can buffer.

source

pub const KEY_UPDATE_ERROR: Self = _

An endpoint detected errors in performing key updates.

source

pub const AEAD_LIMIT_REACHED: Self = _

An endpoint has reached the confidentiality or integrity limit for the AEAD algorithm used by the given connection.

source

pub fn description(&self) -> Option<&'static str>

source§

impl Error

source

pub const fn crypto_error(code: u8) -> Self

Creates a crypto-level TransportError from a TLS alert code.

source

pub fn try_into_tls_error(self) -> Option<Error>

If the Error contains a tls::Error, it is returned

source§

impl Error

source

pub const fn application_error(code: VarInt) -> Self

Creates an application-level Error

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · 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, f: &mut Formatter<'_>) -> Result

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

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

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<DecoderError> for Error

Implements conversion from decoder errors

source§

fn from(decoder_error: DecoderError) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Error> for ConnectionClose<'a>

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

Implements conversion from TLS errors See Error::crypto_error for more details

source§

fn from(tls_error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for ProcessingError

source§

fn from(inner_error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for StreamError

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<VarIntError> for Error

Implements conversion from crypto errors See Error::crypto_error for more details

source§

fn from(_: VarIntError) -> Self

Converts to this type from the input type.
source§

impl Ord for Error

source§

fn cmp(&self, other: &Error) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Error

source§

fn eq(&self, other: &Error) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Error

source§

fn partial_cmp(&self, other: &Error) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Error

source§

impl Eq for Error

source§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin 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.

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> ToOwned for T
where T: Clone,

§

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§

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

§

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

§

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, U> Upcast<T> for U
where T: UpcastFrom<U>,

source§

fn upcast(self) -> T

source§

impl<T, B> UpcastFrom<Counter<T, B>> for T

source§

fn upcast_from(value: Counter<T, B>) -> T