Struct h2::Reason [−][src]
pub struct Reason(_);
HTTP/2.0 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.
Methods
impl Reason
[src]
impl Reason
pub const NO_ERROR: Reason
NO_ERROR: Reason = Reason(0)
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.
pub const PROTOCOL_ERROR: Reason
PROTOCOL_ERROR: Reason = Reason(1)
The endpoint detected an unspecific protocol error.
This error is for use when a more specific error code is not available.
pub const INTERNAL_ERROR: Reason
INTERNAL_ERROR: Reason = Reason(2)
The endpoint encountered an unexpected internal error.
pub const FLOW_CONTROL_ERROR: Reason
FLOW_CONTROL_ERROR: Reason = Reason(3)
The endpoint detected that its peer violated the flow-control protocol.
pub const SETTINGS_TIMEOUT: Reason
SETTINGS_TIMEOUT: Reason = Reason(4)
The endpoint sent a SETTINGS frame but did not receive a response in a timely manner.
pub const STREAM_CLOSED: Reason
STREAM_CLOSED: Reason = Reason(5)
The endpoint received a frame after a stream was half-closed.
pub const FRAME_SIZE_ERROR: Reason
FRAME_SIZE_ERROR: Reason = Reason(6)
The endpoint received a frame with an invalid size.
pub const REFUSED_STREAM: Reason
REFUSED_STREAM: Reason = Reason(7)
The endpoint refused the stream prior to performing any application processing.
pub const CANCEL: Reason
CANCEL: Reason = Reason(8)
Used by the endpoint to indicate that the stream is no longer needed.
pub const COMPRESSION_ERROR: Reason
COMPRESSION_ERROR: Reason = Reason(9)
The endpoint is unable to maintain the header compression context for the connection.
pub const CONNECT_ERROR: Reason
CONNECT_ERROR: Reason = Reason(10)
The connection established in response to a CONNECT request was reset or abnormally closed.
pub const ENHANCE_YOUR_CALM: Reason
ENHANCE_YOUR_CALM: Reason = Reason(11)
The endpoint detected that its peer is exhibiting a behavior that might be generating excessive load.
pub const INADEQUATE_SECURITY: Reason
INADEQUATE_SECURITY: Reason = Reason(12)
The underlying transport has properties that do not meet minimum security requirements.
pub const HTTP_1_1_REQUIRED: Reason
HTTP_1_1_REQUIRED: Reason = Reason(13)
The endpoint requires that HTTP/1.1 be used instead of HTTP/2.
pub fn description(&self) -> &str
[src]
pub fn description(&self) -> &str
Get a string description of the error code.
Trait Implementations
impl From<Reason> for Error
[src]
impl From<Reason> for Error
impl PartialEq for Reason
[src]
impl PartialEq for Reason
fn eq(&self, other: &Reason) -> bool
[src]
fn eq(&self, other: &Reason) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Reason) -> bool
[src]
fn ne(&self, other: &Reason) -> bool
This method tests for !=
.
impl Eq for Reason
[src]
impl Eq for Reason
impl Clone for Reason
[src]
impl Clone for Reason
fn clone(&self) -> Reason
[src]
fn clone(&self) -> Reason
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Reason
[src]
impl Copy for Reason
impl From<u32> for Reason
[src]
impl From<u32> for Reason
impl From<Reason> for u32
[src]
impl From<Reason> for u32
impl Debug for Reason
[src]
impl Debug for Reason
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Display for Reason
[src]
impl Display for Reason