#[repr(i32)]pub enum HttpStreamResetCode {
HsrAbort = 0,
HsrRefused = 1,
HsrInternal = 2,
HsrTimeout = 3,
HsrProtocol = 4,
}Expand description
why a stream was reset before any HTTP bytes flowed. This travels as the QUIC RESET_STREAM / STOP_SENDING error code, so it is a number with no room for detail: the reason string is logged by the side that reset and joined to this by request_id. An outcome after bytes have flowed travels in trailers instead, where it cannot race them.
Variants§
HsrAbort = 0
no information. The ordinary cancel code, sent whenever a stream is torn down without a specific outcome, so it must stay the zero value and must not imply that anything was or was not applied.
HsrRefused = 1
the worker aborted before any application code observed the request, so nothing was applied and the exchange is safe to retry. Requires that the application was never entered; a 404 it returned is an ordinary response.
HsrInternal = 2
the application was entered and then failed before producing a response head; side effects may already have happened, so this is not safe to retry.
HsrTimeout = 3
the deadline elapsed before a response head was produced
HsrProtocol = 4
the peer’s bytes were not valid HTTP/1.1
Implementations§
Source§impl HttpStreamResetCode
impl HttpStreamResetCode
Sourcepub const fn is_valid(value: i32) -> bool
pub const fn is_valid(value: i32) -> bool
Returns true if value is a variant of HttpStreamResetCode.
Sourcepub fn from_i32(value: i32) -> Option<HttpStreamResetCode>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<HttpStreamResetCode>
Use the TryFrom<i32> implementation instead
Converts an i32 to a HttpStreamResetCode, or None if value is not a valid variant.
Source§impl HttpStreamResetCode
impl HttpStreamResetCode
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.