pub struct Reason(_);
Expand description
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.
Implementations
sourceimpl 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 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 StructuralEq for Reason
impl StructuralPartialEq for Reason
Auto Trait Implementations
impl RefUnwindSafe for Reason
impl Send for Reason
impl Sync for Reason
impl Unpin for Reason
impl UnwindSafe for Reason
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more