Enum afire::header::HeaderType

source ·
pub enum HeaderType {
Show 21 variants Accept, AcceptCharset, AcceptEncoding, AcceptLanguage, Connection, ContentEncoding, ContentLength, ContentType, Cookie, Date, Host, Location, Referer, Server, SetCookie, TransferEncoding, Upgrade, UserAgent, Via, XForwardedFor, Custom(String),
}
Expand description

Common HTTP headers. Just the ‘common’ ones, which are ones that I use semi-frequently, or that are used internally.

Variants§

§

Accept

Indicates what content types (MIME types) are acceptable for the client. (MDN)

§

AcceptCharset

Indicates what character sets are acceptable for the client. (MDN)

§

AcceptEncoding

Indicates what content encodings (usually compression algorithms) are acceptable for the client. (MDN)

§

AcceptLanguage

Indicates what languages are acceptable for the client. (MDN)

§

Connection

Allows re-using a socket for multiple requests with keep-alive, or closing the sockets with close. (MDN)

§

ContentEncoding

Lists the encodings that have been applied to the entity body. See HeaderType::AcceptEncoding (MDN)

§

ContentLength

An integer indicating the size of the entity body in bytes. This is only required when the body is not chunked. (MDN)

§

ContentType

Indicates the media type of the entity body. This can be set on a response with the crate::Response::content method. (MDN)

§

Cookie

Contains cookies from the client. (MDN)

§

Date

The date and time at which the message was originated. (MDN)

§

Host

Sent with requests to indicate the host and port of the server to which the request is being sent. This allows for reverse proxies to forward requests to the correct server. (MDN)

§

Location

Used with redirection status codes (301, 302, 303, 307, 308) to indicate the URL to redirect to. (MDN)

§

Referer

Contains the address of the webpage that linked to the resource being requested. Note the misspelling of referrer as ‘referer’ in the HTTP spec. (MDN)

§

Server

An identifier for a specific name / version of the web server software. This is set to afire/VERSION by default. (MDN)

§

SetCookie

Used to send cookies from the server to the client. Its recommended to use the crate::SetCookie builder instead of this directly. (MDN)

§

TransferEncoding

Specifies the transfer encoding of the message body. (MDN)

§

Upgrade

Used to switch from HTTP to a different protocol on the same socket, often used for websockets. Note that afire currently does not have built-in support for websockets. (MDN)

§

UserAgent

Contains information about the client application, operating system, vendor, etc. that is making the request. (MDN)

§

Via

A header added by proxies to track message forewords, avoid request loops, and identifying protocol capabilities. (MDN)

§

XForwardedFor

A header often added by reverse proxies to allow web servers to know from which IP a request is originating. This is not an official HTTP header, but is still widely used. (MDN)

§

Custom(String)

Any other header that is not in this enum.

Trait Implementations§

source§

impl Clone for HeaderType

source§

fn clone(&self) -> HeaderType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HeaderType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for HeaderType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&HeaderType> for HeaderType

source§

fn from(s: &HeaderType) -> Self

Converts to this type from the input type.
source§

impl<T: AsRef<str>> From<T> for HeaderType

source§

fn from(s: T) -> Self

Converts to this type from the input type.
source§

impl Hash for HeaderType

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<HeaderType> for HeaderType

source§

fn eq(&self, other: &HeaderType) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for HeaderType

source§

impl StructuralEq for HeaderType

source§

impl StructuralPartialEq for HeaderType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.