pub enum HttpHeaderName {
Show 45 variants
Accept,
AcceptCharset,
AcceptEncoding,
AcceptLanguage,
AccessControlRequestMethod,
AccessControlRequestHeaders,
Authorization,
CacheControl,
Connection,
ContentEncoding,
ContentLength,
ContentType,
Cookie,
Date,
Expect,
Forwarded,
From,
Host,
Origin,
Pragma,
Referer,
Upgrade,
UserAgent,
Via,
Warning,
AccessControlAllowOrigin,
AccessControlAllowHeaders,
AccessControlAllowMethods,
Age,
Allow,
ContentDisposition,
ContentLanguage,
ContentLocation,
ETag,
Expires,
LastModified,
Link,
Location,
Server,
SetCookie,
TransferEncoding,
TE,
Trailer,
ProxyAuthenticate,
Custom(String),
}Expand description
Represents a header received in a request. TODO implement to &str fn to prevent clone on serialization!
Variants§
Accept
Informs the server about the types of data that can be sent back.
AcceptCharset
Informs the server about the accepted character encodings.
AcceptEncoding
Indicates the content encoding(s) understood by the client, usually compression algorithms.
AcceptLanguage
Informs the server about the client’s language(s).
AccessControlRequestMethod
Indicates the method that will be used for the actual request when performing an OPTIONS request.
AccessControlRequestHeaders
Indicates the headers that will be used for the actual request when performing an OPTIONS request.
Authorization
Provides credentials for HTTP authentication.
CacheControl
Indicates how the cache should behave.
Connection
Indicates what should happen to the connection after the request is served.
ContentEncoding
Lists any encodings used on the payload.
ContentLength
Indicates the length of the payload body.
ContentType
Indicates the MIME type of the payload body.
Cookie
Shares any applicable HTTP cookies with the server.
Date
Indicates the date and time at which the request was sent.
Expect
Indicates any expectations that must be met by the server in order to properly serve the request.
Forwarded
May contain reverse proxy information, generally not used in favour of the X-Forwarded-For header.
From
Indicates the email address of the client, often used by crawlers.
Host
Specifies the host to which the request is being sent, e.g. “www.example.com”.
Origin
Indicates the origin that caused the request.
Pragma
Contains backwards-compatible caching information.
Referer
Indicates the absolute or partial address of the page making the request.
Upgrade
Indicates that the connection is to be upgraded to a different protocol, e.g. WebSocket.
UserAgent
Informs the server of basic browser and device information.
Via
Contains the addresses of proxies through which the request has been forwarded.
Warning
Contains information about possible problems with the request.
AccessControlAllowOrigin
Indicates whether the response can be shared with other origins.
AccessControlAllowHeaders
Indicates whether certain headers can be set.
AccessControlAllowMethods
Indicates whether certain methods can be used.
Age
Contains the time in seconds that the object has been cached.
Allow
The set of methods supported by the resource.
ContentDisposition
Indicates whether the response is to be displayed as a webpage or downloaded directly.
ContentLanguage
Informs the client of the language of the payload body.
ContentLocation
Indicates an alternative location for the returned data.
ETag
Identifies a specific version of a resource.
Expires
Contains the date and time at which the response is considered expired.
LastModified
Indicates the date and time at which the response was last modified.
Link
Provides a means for serialising links in the headers, equivalent to the HTML <link> element.
Location
Indicates the location at which the resource can be found, used for redirects.
Server
Contains information about the server which served the request.
SetCookie
Indicates that the client should set the specified cookies.
TransferEncoding
Indicates the encoding used in the transfer of the payload body.
TE
Trailer
Trailer encoding
ProxyAuthenticate
Indicates that a proxy server in the connection needs authentication.
Custom(String)
Custom header with a lowercase name
Implementations§
Source§impl HttpHeaderName
impl HttpHeaderName
Sourcepub fn well_known() -> &'static [HttpHeaderName]
pub fn well_known() -> &'static [HttpHeaderName]
Returns a static array of all well known header types
Sourcepub fn is_custom(&self) -> bool
pub fn is_custom(&self) -> bool
Returns true if the header is not well known and the name is heap allocated.
Sourcepub fn is_well_known(&self) -> bool
pub fn is_well_known(&self) -> bool
Returns true if the header is well known and not heap allocated.
Sourcepub fn to_str(&self) -> &str
pub fn to_str(&self) -> &str
Returns a &str of the header value without copying. This has the same lifetime as self because the header string may be a custom header that is heap allocated.
Sourcepub fn well_known_str(&self) -> Option<&'static str>
pub fn well_known_str(&self) -> Option<&'static str>
Return Some with a static lifetime if self is not a heap allocated custom header. If self is a custom header that is heap allocated (and therefore has a non-static lifetime) It will return none
Trait Implementations§
Source§impl AsRef<str> for HttpHeaderName
impl AsRef<str> for HttpHeaderName
Source§impl Clone for HttpHeaderName
impl Clone for HttpHeaderName
Source§fn clone(&self) -> HttpHeaderName
fn clone(&self) -> HttpHeaderName
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more