pub struct Reason(/* private fields */);
Expand description
HTTP/2 error codes.
Error codes are used in RST_STREAM
and GOAWAY
frames to convey the
reasons for the stream or connection error. For example,
SendStream::send_reset
takes a Reason
argument. Also, the Error
type
may contain a Reason
.
Error codes share a common code space. Some error codes apply only to streams, others apply only to connections, and others may apply to either. See [RFC 7540] for more information.
Implementations§
Source§impl Reason
impl Reason
Sourcepub const NO_ERROR: Reason = _
pub const NO_ERROR: Reason = _
The associated condition is not a result of an error.
For example, a GOAWAY might include this code to indicate graceful shutdown of a connection.
Sourcepub const PROTOCOL_ERROR: Reason = _
pub const PROTOCOL_ERROR: Reason = _
The endpoint detected an unspecific protocol error.
This error is for use when a more specific error code is not available.
Sourcepub const INTERNAL_ERROR: Reason = _
pub const INTERNAL_ERROR: Reason = _
The endpoint encountered an unexpected internal error.
Sourcepub const FLOW_CONTROL_ERROR: Reason = _
pub const FLOW_CONTROL_ERROR: Reason = _
The endpoint detected that its peer violated the flow-control protocol.
Sourcepub const SETTINGS_TIMEOUT: Reason = _
pub const SETTINGS_TIMEOUT: Reason = _
The endpoint sent a SETTINGS frame but did not receive a response in a timely manner.
Sourcepub const STREAM_CLOSED: Reason = _
pub const STREAM_CLOSED: Reason = _
The endpoint received a frame after a stream was half-closed.
Sourcepub const FRAME_SIZE_ERROR: Reason = _
pub const FRAME_SIZE_ERROR: Reason = _
The endpoint received a frame with an invalid size.
Sourcepub const REFUSED_STREAM: Reason = _
pub const REFUSED_STREAM: Reason = _
The endpoint refused the stream prior to performing any application processing.
Sourcepub const CANCEL: Reason = _
pub const CANCEL: Reason = _
Used by the endpoint to indicate that the stream is no longer needed.
Sourcepub const COMPRESSION_ERROR: Reason = _
pub const COMPRESSION_ERROR: Reason = _
The endpoint is unable to maintain the header compression context for the connection.
Sourcepub const CONNECT_ERROR: Reason = _
pub const CONNECT_ERROR: Reason = _
The connection established in response to a CONNECT request was reset or abnormally closed.
Sourcepub const ENHANCE_YOUR_CALM: Reason = _
pub const ENHANCE_YOUR_CALM: Reason = _
The endpoint detected that its peer is exhibiting a behavior that might be generating excessive load.
Sourcepub const INADEQUATE_SECURITY: Reason = _
pub const INADEQUATE_SECURITY: Reason = _
The underlying transport has properties that do not meet minimum security requirements.
Sourcepub const HTTP_1_1_REQUIRED: Reason = _
pub const HTTP_1_1_REQUIRED: Reason = _
The endpoint requires that HTTP/1.1 be used instead of HTTP/2.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Get a string description of the error code.
Trait Implementations§
impl Copy for Reason
impl Eq for Reason
impl StructuralPartialEq for Reason
Auto Trait Implementations§
impl Freeze for Reason
impl RefUnwindSafe for Reason
impl Send for Reason
impl Sync for Reason
impl Unpin for Reason
impl UnwindSafe for Reason
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.