pub enum HeaderId {
Show 34 variants
Host,
ContentLength,
ContentType,
TransferEncoding,
Connection,
Expect,
Upgrade,
Date,
Server,
Accept,
AcceptEncoding,
AcceptLanguage,
Authorization,
CacheControl,
Cookie,
SetCookie,
Etag,
IfNoneMatch,
IfModifiedSince,
LastModified,
Location,
Referer,
UserAgent,
Vary,
Allow,
Trailer,
Te,
ContentEncoding,
ContentLanguage,
Range,
IfMatch,
IfUnmodifiedSince,
Origin,
Other(ByteStr),
}Expand description
An interned HTTP field name.
Variants§
Host
host
ContentLength
content-length
ContentType
content-type
TransferEncoding
transfer-encoding
Connection
connection
Expect
expect
Upgrade
upgrade
Date
date
Server
server
Accept
accept
AcceptEncoding
accept-encoding
AcceptLanguage
accept-language
Authorization
authorization
CacheControl
cache-control
Cookie
cookie
SetCookie
set-cookie
Etag
etag
IfNoneMatch
if-none-match
IfModifiedSince
if-modified-since
LastModified
last-modified
Location
location
Referer
referer
UserAgent
user-agent
Vary
vary
Allow
allow
Trailer
trailer
Te
te
ContentEncoding
content-encoding
ContentLanguage
content-language
Range
range
IfMatch
if-match
IfUnmodifiedSince
if-unmodified-since
Origin
origin
Other(ByteStr)
Any other valid field name, lowercased at parse time.
Implementations§
Source§impl HeaderId
impl HeaderId
Sourcepub const WELL_KNOWN: &'static [HeaderId]
pub const WELL_KNOWN: &'static [HeaderId]
Every well-known variant, for round-trip testing and diagnostics.
Sourcepub fn from_bytes(name: &[u8]) -> Option<HeaderId>
pub fn from_bytes(name: &[u8]) -> Option<HeaderId>
Match a field name against the well-known set, case-insensitively.
Returns None when the name is not well-known; the caller then builds
HeaderId::Other from the read buffer.
Dispatching on length first bounds each call to one integer comparison plus a short case-insensitive compare. Field names are case-insensitive per RFC 9110 section 5.1.
Sourcepub fn is_hop_by_hop(&self) -> bool
pub fn is_hop_by_hop(&self) -> bool
Whether this field is hop-by-hop and must not be forwarded.
Sourcepub fn forbidden_in_trailers(&self) -> bool
pub fn forbidden_in_trailers(&self) -> bool
Whether RFC 9110 section 6.5.1 forbids this field in a trailer section.
Framing fields are the critical entries: a Transfer-Encoding or
Content-Length accepted from a trailer is a request-smuggling vector,
because framing was already decided before the trailer was read.
Trait Implementations§
impl Eq for HeaderId
impl StructuralPartialEq for HeaderId
Auto Trait Implementations§
impl !Freeze for HeaderId
impl RefUnwindSafe for HeaderId
impl Send for HeaderId
impl Sync for HeaderId
impl Unpin for HeaderId
impl UnsafeUnpin for HeaderId
impl UnwindSafe for HeaderId
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R, D> DepsPresent<D> for R
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.