pub enum H3Error {
Show 17 variants
NoError,
GeneralProtocol,
Internal,
StreamCreation,
ClosedCriticalStream,
FrameUnexpected,
FrameError,
ExcessiveLoad,
Id,
Settings,
MissingSettings,
RequestRejected,
RequestCancelled,
RequestIncomplete,
Message,
Connect,
VersionFallback,
}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
impl H3Error
Sourcepub const fn from_code(code: u64) -> Option<H3Error>
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§
impl Copy for H3Error
impl Eq for H3Error
Source§impl Error for H3Error
impl Error for H3Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()