Skip to main content

H3Error

Enum H3Error 

Source
pub enum H3Error {
Show 17 variants NoError, GeneralProtocol, Internal, StreamCreation, ClosedCriticalStream, FrameUnexpected, FrameError, ExcessiveLoad, Id, Settings, MissingSettings, RequestRejected, RequestCancelled, RequestIncomplete, Message, Connect, VersionFallback,
}
Available on crate feature h3 only.
Expand description

Typed HTTP/3 application errors (RFC 9114 Section 8.1).

Each variant carries the error code it is sent as in RESET_STREAM, STOP_SENDING, and CONNECTION_CLOSE frames.

Variants§

§

NoError

H3_NO_ERROR (0x0100): no error; used to close cleanly.

§

GeneralProtocol

H3_GENERAL_PROTOCOL_ERROR (0x0101): a protocol violation that no more specific code covers.

§

Internal

H3_INTERNAL_ERROR (0x0102): an internal error in the HTTP stack.

§

StreamCreation

H3_STREAM_CREATION_ERROR (0x0103): the peer created a stream this endpoint will not accept.

§

ClosedCriticalStream

H3_CLOSED_CRITICAL_STREAM (0x0104): a stream required by the connection (control, QPACK encoder or decoder) was closed or reset.

§

FrameUnexpected

H3_FRAME_UNEXPECTED (0x0105): a frame that is not permitted in the current state or on the current stream.

§

FrameError

H3_FRAME_ERROR (0x0106): a frame that violates layout requirements or has an invalid size.

§

ExcessiveLoad

H3_EXCESSIVE_LOAD (0x0107): the peer is generating excessive load.

§

Id

H3_ID_ERROR (0x0108): a stream ID or push ID used incorrectly.

§

Settings

H3_SETTINGS_ERROR (0x0109): an error in the payload of a SETTINGS frame.

§

MissingSettings

H3_MISSING_SETTINGS (0x010a): no SETTINGS frame at the start of the control stream.

§

RequestRejected

H3_REQUEST_REJECTED (0x010b): a server rejected a request without application processing.

§

RequestCancelled

H3_REQUEST_CANCELLED (0x010c): the request or its response was cancelled.

§

RequestIncomplete

H3_REQUEST_INCOMPLETE (0x010d): a stream terminated without a fully formed request.

§

Message

H3_MESSAGE_ERROR (0x010e): an HTTP message was malformed.

§

Connect

H3_CONNECT_ERROR (0x010f): the TCP connection behind a CONNECT request was reset or abnormally closed.

§

VersionFallback

H3_VERSION_FALLBACK (0x0110): the requested operation cannot be served over HTTP/3; the peer should retry over HTTP/1.1.

Implementations§

Source§

impl H3Error

Source

pub const fn code(self) -> u64

The RFC 9114 Section 8.1 error code for this error.

Source

pub const fn from_code(code: u64) -> Option<H3Error>

Looks up a known HTTP/3 error by its RFC 9114 Section 8.1 code.

Returns None for unknown codes. Per RFC 9114 Section 8.1, unknown codes — including the reserved 0x1f * N + 0x21 family — are treated as equivalent to H3Error::NoError by the wire protocol.

Trait Implementations§

Source§

impl Clone for H3Error

Source§

fn clone(&self) -> H3Error

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 Copy for H3Error

Source§

impl Debug for H3Error

Source§

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

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

impl Display for H3Error

Source§

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

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

impl Eq for H3Error

Source§

impl Error for H3Error

1.30.0 · 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<H3Error> for Error

Source§

fn from(err: H3Error) -> Error

Converts to this type from the input type.
Source§

impl PartialEq for H3Error

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for H3Error

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