pub struct Header {
    pub name: String,
    pub value: String,
}

Fields§

§name: String§value: String

Implementations§

source§

impl Header

source

pub fn as_string(&self) -> String

source

pub const _ACCESS_CONTROL_REQUEST_METHOD: &'static str = "Access-Control-Request-Method"

source

pub const _ACCESS_CONTROL_REQUEST_HEADERS: &'static str = "Access-Control-Request-Headers"

source

pub const _ACCESS_CONTROL_ALLOW_ORIGIN: &'static str = "Access-Control-Allow-Origin"

source

pub const _ACCESS_CONTROL_ALLOW_METHODS: &'static str = "Access-Control-Allow-Methods"

source

pub const _ACCESS_CONTROL_ALLOW_HEADERS: &'static str = "Access-Control-Allow-Headers"

source

pub const _ACCESS_CONTROL_ALLOW_CREDENTIALS: &'static str = "Access-Control-Allow-Credentials"

source

pub const _ACCESS_CONTROL_MAX_AGE: &'static str = "Access-Control-Max-Age"

source

pub const _ACCESS_CONTROL_EXPOSE_HEADERS: &'static str = "Access-Control-Expose-Headers"

source

pub const _ACCEPT: &'static str = "Accept"

source

pub const _ACCEPT_RANGES: &'static str = "Accept-Ranges"

source

pub const _ACCEPT_CH: &'static str = "Accept-CH"

source

pub const _ACCEPT_ENCODING: &'static str = "Accept-Encoding"

source

pub const _ACCEPT_LANGUAGE: &'static str = "Accept-Language"

source

pub const _ACCEPT_PATCH: &'static str = "Accept-Patch"

source

pub const _ACCEPT_POST: &'static str = "Accept-Post"

source

pub const _AGE: &'static str = "Age"

source

pub const _ALLOW: &'static str = "Allow"

source

pub const _ALT_SVC: &'static str = "Alt-Svc"

source

pub const _AUTHORIZATION: &'static str = "Authorization"

source

pub const _CACHE_CONTROL: &'static str = "Cache-Control"

source

pub const _CLEAR_SITE_DATA: &'static str = "Clear-Site-Data"

source

pub const _CONTENT_TYPE: &'static str = "Content-Type"

source

pub const _CONTENT_LENGTH: &'static str = "Content-Length"

source

pub const _CONTENT_RANGE: &'static str = "Content-Range"

source

pub const _CONTENT_DISPOSITION: &'static str = "Content-Disposition"

source

pub const _CONTENT_ENCODING: &'static str = "Content-Encoding"

source

pub const _CONTENT_LANGUAGE: &'static str = "Content-Language"

source

pub const _CONTENT_LOCATION: &'static str = "Content-Location"

source

pub const _CONTENT_SECURITY_POLICY: &'static str = "Content-Security-Policy"

source

pub const _CONTENT_SECURITY_POLICY_REPORT_ONLY: &'static str = "Content-Security-Policy-Report-Only"

source

pub const _CROSS_ORIGIN_EMBEDDER_POLICY: &'static str = "Cross-Origin-Embedder-Policy"

source

pub const _CROSS_ORIGIN_OPENER_POLICY: &'static str = "Cross-Origin-Opener-Policy"

source

pub const _CROSS_ORIGIN_RESOURCE_POLICY: &'static str = "Cross-Origin-Resource-Policy"

source

pub const _DATE: &'static str = "Date"

source

pub const _DATE_UNIX_EPOCH_NANOS: &'static str = "Date-Unix-Epoch-Nanos"

source

pub const _DEVICE_MEMORY: &'static str = "Device-Memory"

source

pub const _DIGEST: &'static str = "Digest"

source

pub const _EARLY_DATA: &'static str = "Early-Data"

source

pub const _ECT: &'static str = "ECT"

source

pub const _ETAG: &'static str = "ETag"

source

pub const _EXPECT: &'static str = "Expect"

source

pub const _EXPIRES: &'static str = "Expires"

source

pub const _FEATURE_POLICY: &'static str = "Feature-Policy"

source

pub const _PERMISSIONS_POLICY: &'static str = "Permissions-Policy"

source

pub const _FORWARDED: &'static str = "Forwarded"

source

pub const _FROM: &'static str = "From"

source

pub const _HOST: &'static str = "Host"

source

pub const _IF_MATCH: &'static str = "If-Match"

source

pub const _IF_MODIFIED_SINCE: &'static str = "If-Modified-Since"

source

pub const _IF_NONE_MATCH: &'static str = "If-None-Match"

source

pub const _IF_RANGE: &'static str = "If-Range"

source

pub const _IF_UNMODIFIED_SINCE: &'static str = "If-Unmodified-Since"

source

pub const _LAST_MODIFIED: &'static str = "Last-Modified"

source

pub const _LAST_MODIFIED_UNIX_EPOCH_NANOS: &'static str = "Last-Modified-Unix-Epoch-Nanos"

source

pub const _LOCATION: &'static str = "Location"

source

pub const _MAX_FORWARDS: &'static str = "Max-Forwards"

source

pub const _NEL: &'static str = "NEL"

source

pub const _ORIGIN: &'static str = "Origin"

source

pub const _PROXY_AUTHENTICATE: &'static str = "Proxy-Authenticate"

source

pub const _PROXY_AUTHORIZATION: &'static str = "Proxy-Authorization"

source

pub const _RANGE: &'static str = "Range"

source

pub const _REFERER: &'static str = "Referer"

source

pub const _REFERRER_POLICY: &'static str = "Referrer-Policy"

source

pub const _RETRY_AFTER: &'static str = "Retry-After"

source

pub const _RTT: &'static str = "RTT"

source

pub const _SAVE_DATA: &'static str = "Save-Data"

source

pub const _SEC_CH_UA: &'static str = "Sec-CH-UA"

source

pub const _SEC_CH_UA_ARCH: &'static str = "Sec-CH-UA-Arch"

source

pub const _SEC_CH_UA_BITNESS: &'static str = "Sec-CH-UA-Bitness"

source

pub const _SEC_CH_UA_FULL_VERSION_LIST: &'static str = "Sec-CH-UA-Full-Version-List"

source

pub const _SEC_CH_UA_MOBILE: &'static str = "Sec-CH-UA-Mobile"

source

pub const _SEC_CH_UA_MODEL: &'static str = "Sec-CH-UA-Model"

source

pub const _SEC_CH_UA_PLATFORM: &'static str = "Sec-CH-UA-Platform"

source

pub const _SEC_CH_UA_PLATFORM_VERSION: &'static str = "Sec-CH-UA-Platform-Version"

source

pub const _SEC_FETCH_DEST: &'static str = "Sec-Fetch-Dest"

source

pub const _SEC_FETCH_MODE: &'static str = "Sec-Fetch-Mode"

source

pub const _SEC_FETCH_SITE: &'static str = "Sec-Fetch-Site"

source

pub const _SEC_FETCH_USER: &'static str = "Sec-Fetch-User"

source

pub const _SEC_GPC: &'static str = "Sec-GPC"

source

pub const _SERVER: &'static str = "Server"

source

pub const _SERVER_TIMING: &'static str = "Server-Timing"

source

pub const _SERVICE_WORKER_NAVIGATION_PRELOAD: &'static str = "Service-Worker-Navigation-Preload"

source

pub const _SOURCE_MAP: &'static str = "SourceMap"

source

pub const _STRICT_TRANSPORT_SECURITY: &'static str = "Strict-Transport-Security"

source

pub const _TE: &'static str = "TE"

source

pub const _TIMING_ALLOW_ORIGIN: &'static str = "Timing-Allow-Origin"

source

pub const _TRAILER: &'static str = "Trailer"

source

pub const _TRANSFER_ENCODING: &'static str = "Transfer-Encoding"

source

pub const _UPGRADE: &'static str = "Upgrade"

source

pub const _UPGRADE_INSECURE_REQUESTS: &'static str = "Upgrade-Insecure-Requests"

source

pub const _USER_AGENT: &'static str = "User-Agent"

source

pub const _VARY: &'static str = "Vary"

source

pub const _VIA: &'static str = "Via"

source

pub const _WANT_DIGEST: &'static str = "Want-Digest"

source

pub const _WWW_AUTHENTICATE: &'static str = "WWW-Authenticate"

source

pub const _X_CONTENT_TYPE_OPTIONS: &'static str = "X-Content-Type-Options"

source

pub const _X_CONTENT_TYPE_OPTIONS_VALUE_NOSNIFF: &'static str = "nosniff"

source

pub const _X_FRAME_OPTIONS: &'static str = "X-Frame-Options"

source

pub const _X_FRAME_OPTIONS_VALUE_DENY: &'static str = "DENY"

source

pub const _X_FRAME_OPTIONS_VALUE_SAME_ORIGIN: &'static str = "SAMEORIGIN"

source

pub const NAME_VALUE_SEPARATOR: &'static str = ": "

source

pub const _DO_NOT_STORE_CACHE: &'static str = "no-store, no-cache, private, max-age=0, must-revalidate, proxy-revalidate"

source

pub fn get_header_list(request: &Request) -> Vec<Header>

source

pub fn get_x_content_type_options_header() -> Header

source

pub fn get_accept_ranges_header() -> Header

source

pub fn get_x_frame_options_header() -> Header

source

pub fn get_date_iso_8601_header() -> Header

source

pub fn get_no_cache_header() -> Header

source

pub fn parse_header(raw_header: &str) -> Result<Header, String>

source

pub fn parse(raw_header: &str) -> Result<Header, String>

source

pub fn generate(&self) -> String

Trait Implementations§

source§

impl Clone for Header

source§

fn clone(&self) -> Header

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 Header

source§

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

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

impl PartialEq<Header> for Header

source§

fn eq(&self, other: &Header) -> 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 Header

source§

impl StructuralEq for Header

source§

impl StructuralPartialEq for Header

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, 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.