Skip to main content

KnownHeaderName

Enum KnownHeaderName 

#[non_exhaustive]
#[repr(u8)]
pub enum KnownHeaderName {
Show 167 variants Host = 0, Date = 1, Accept = 2, AcceptCh = 3, AcceptChLifetime = 4, AcceptCharset = 5, AcceptEncoding = 6, AcceptLanguage = 7, AcceptPushPolicy = 8, AcceptRanges = 9, AcceptSignature = 10, AccessControlAllowCredentials = 11, AccessControlAllowHeaders = 12, AccessControlAllowMethods = 13, AccessControlAllowOrigin = 14, AccessControlExposeHeaders = 15, AccessControlMaxAge = 16, AccessControlRequestHeaders = 17, AccessControlRequestMethod = 18, Age = 19, Allow = 20, AltSvc = 21, AltUsed = 22, AuthenticationInfo = 23, Authorization = 24, CacheControl = 25, CdnCacheControl = 26, ClearSiteData = 27, Connection = 28, ContentDpr = 29, ContentDigest = 30, ContentDisposition = 31, ContentEncoding = 32, ContentLanguage = 33, ContentLength = 34, ContentLocation = 35, ContentRange = 36, ContentSecurityPolicy = 37, ContentSecurityPolicyReportOnly = 38, ContentType = 39, Cookie = 40, Cookie2 = 41, CrossOriginEmbedderPolicy = 42, CrossOriginOpenerPolicy = 43, CrossOriginResourcePolicy = 44, Dnt = 45, Dpr = 46, Dpop = 47, Deprecation = 48, DeviceMemory = 49, Digest = 50, Downlink = 51, Ect = 52, Etag = 53, EarlyData = 54, Expect = 55, ExpectCt = 56, Expires = 57, FeaturePolicy = 58, Forwarded = 59, From = 60, IfMatch = 61, IfModifiedSince = 62, IfNoneMatch = 63, IfRange = 64, IfUnmodifiedSince = 65, KeepAlive = 66, LargeAllocation = 67, LastEventId = 68, LastModified = 69, Link = 70, Location = 71, MaxForwards = 72, Nel = 73, Origin = 74, OriginIsolation = 75, PermissionsPolicy = 76, PingFrom = 77, PingTo = 78, Pragma = 79, Priority = 80, ProxyAuthenticate = 81, ProxyAuthenticationInfo = 82, ProxyAuthorization = 83, ProxyConnection = 84, ProxyStatus = 85, PublicKeyPins = 86, PublicKeyPinsReportOnly = 87, Purpose = 88, PushPolicy = 89, Rtt = 90, Range = 91, RatelimitReset = 92, RatelimitLimit = 93, RatelimitRemaining = 94, Referer = 95, ReferrerPolicy = 96, Refresh = 97, RefreshCache = 98, ReportTo = 99, ReprDigest = 100, RetryAfter = 101, SaveData = 102, SecChUa = 103, SecChUAMobile = 104, SecChUAPlatform = 105, SecFetchDest = 106, SecFetchMode = 107, SecFetchSite = 108, SecFetchUser = 109, SecGpc = 110, SecWebsocketAccept = 111, SecWebsocketExtensions = 112, SecWebsocketKey = 113, SecWebsocketProtocol = 114, SecWebsocketVersion = 115, Server = 116, ServerTiming = 117, ServiceWorkerAllowed = 118, SetCookie = 119, SetCookie2 = 120, Signature = 121, SignedHeaders = 122, Sourcemap = 123, StrictTransportSecurity = 124, Te = 125, TimingAllowOrigin = 126, Traceparent = 127, Tracestate = 128, Trailer = 129, TransferEncoding = 130, Upgrade = 131, UpgradeInsecureRequests = 132, UserAgent = 133, Vary = 134, Via = 135, ViewportWidth = 136, WwwAuthenticate = 137, WantContentDigest = 138, WantDigest = 139, WantReprDigest = 140, Warning = 141, Width = 142, Xb3Traceid = 143, Xcache = 144, XcontentTypeOptions = 145, XcorrelationId = 146, XdnsPrefetchControl = 147, XdownloadOptions = 148, XfirefoxSpdy = 149, XforwardedBy = 150, XforwardedFor = 151, XforwardedHost = 152, XforwardedProto = 153, XforwardedSsl = 154, XframeOptions = 155, XpermittedCrossDomainPolicies = 156, Xpingback = 157, XpoweredBy = 158, XrealIp = 159, XrequestId = 160, XrequestedWith = 161, XrobotsTag = 162, Xruntime = 163, XservedBy = 164, XuaCompatible = 165, XxssProtection = 166,
}
Expand description

A short non-exhaustive enum of headers that trillium represents as an enum.

Use a KnownHeaderName variant instead of a &’static str anywhere possible, as it allows trillium to skip parsing the header entirely.

Please do not rely on the u8 representation being stable between releases.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Host = 0

The Host header.

§

Date = 1

The Date header.

§

Accept = 2

The Accept header.

§

AcceptCh = 3

The Accept-CH header.

§

AcceptChLifetime = 4

The Accept-CH-Lifetime header.

§

AcceptCharset = 5

The Accept-Charset header.

§

AcceptEncoding = 6

The Accept-Encoding header.

§

AcceptLanguage = 7

The Accept-Language header.

§

AcceptPushPolicy = 8

The Accept-Push-Policy header.

§

AcceptRanges = 9

The Accept-Ranges header.

§

AcceptSignature = 10

The Accept-Signature header.

§

AccessControlAllowCredentials = 11

§

AccessControlAllowHeaders = 12

§

AccessControlAllowMethods = 13

§

AccessControlAllowOrigin = 14

§

AccessControlExposeHeaders = 15

§

AccessControlMaxAge = 16

§

AccessControlRequestHeaders = 17

§

AccessControlRequestMethod = 18

§

Age = 19

The Age header.

§

Allow = 20

The Allow header.

§

AltSvc = 21

The Alt-Svc header.

§

AltUsed = 22

The Alt-Used header.

§

AuthenticationInfo = 23

The Authentication-Info header.

§

Authorization = 24

The Authorization header.

§

CacheControl = 25

The Cache-Control header.

§

CdnCacheControl = 26

The CDN-Cache-Control header.

§

ClearSiteData = 27

The Clear-Site-Data header.

§

Connection = 28

The Connection header.

§

ContentDpr = 29

The Content-DPR header.

§

ContentDigest = 30

The Content-Digest header.

§

ContentDisposition = 31

The Content-Disposition header.

§

ContentEncoding = 32

The Content-Encoding header.

§

ContentLanguage = 33

The Content-Language header.

§

ContentLength = 34

The Content-Length header.

§

ContentLocation = 35

The Content-Location header.

§

ContentRange = 36

The Content-Range header.

§

ContentSecurityPolicy = 37

§

ContentSecurityPolicyReportOnly = 38

§

ContentType = 39

The Content-Type header.

§

Cookie = 40

The Cookie header.

§

Cookie2 = 41

The Cookie2 header.

§

CrossOriginEmbedderPolicy = 42

§

CrossOriginOpenerPolicy = 43

§

CrossOriginResourcePolicy = 44

§

Dnt = 45

The DNT header.

§

Dpr = 46

The DPR header.

§

Dpop = 47

The DPoP header.

§

Deprecation = 48

The Deprecation header.

§

DeviceMemory = 49

The Device-Memory header.

§

Digest = 50

The Digest header.

The Downlink header.

§

Ect = 52

The ECT header.

§

Etag = 53

The ETag header.

§

EarlyData = 54

The Early-Data header.

§

Expect = 55

The Expect header.

§

ExpectCt = 56

The Expect-CT header.

§

Expires = 57

The Expires header.

§

FeaturePolicy = 58

The Feature-Policy header.

§

Forwarded = 59

The Forwarded header.

§

From = 60

The From header.

§

IfMatch = 61

The If-Match header.

§

IfModifiedSince = 62

The If-Modified-Since header.

§

IfNoneMatch = 63

The If-None-Match header.

§

IfRange = 64

The If-Range header.

§

IfUnmodifiedSince = 65

The If-Unmodified-Since header.

§

KeepAlive = 66

The Keep-Alive header.

§

LargeAllocation = 67

The Large-Allocation header.

§

LastEventId = 68

The Last-Event-ID header.

§

LastModified = 69

The Last-Modified header.

The Link header.

§

Location = 71

The Location header.

§

MaxForwards = 72

The Max-Forwards header.

§

Nel = 73

The NEL header.

§

Origin = 74

The Origin header.

§

OriginIsolation = 75

The Origin-Isolation header.

§

PermissionsPolicy = 76

The Permissions-Policy header.

§

PingFrom = 77

The Ping-From header.

§

PingTo = 78

The Ping-To header.

§

Pragma = 79

The Pragma header.

§

Priority = 80

The Priority header.

§

ProxyAuthenticate = 81

The Proxy-Authenticate header.

§

ProxyAuthenticationInfo = 82

§

ProxyAuthorization = 83

The Proxy-Authorization header.

§

ProxyConnection = 84

The Proxy-Connection header.

§

ProxyStatus = 85

The Proxy-Status header.

§

PublicKeyPins = 86

The Public-Key-Pins header.

§

PublicKeyPinsReportOnly = 87

§

Purpose = 88

The Purpose header.

§

PushPolicy = 89

The Push-Policy header.

§

Rtt = 90

The RTT header.

§

Range = 91

The Range header.

§

RatelimitReset = 92

The RateLimit-Reset header.

§

RatelimitLimit = 93

The Ratelimit-Limit header.

§

RatelimitRemaining = 94

The Ratelimit-Remaining header.

§

Referer = 95

The Referer header.

§

ReferrerPolicy = 96

The Referrer-Policy header.

§

Refresh = 97

The Refresh header.

§

RefreshCache = 98

The Refresh-Cache header.

§

ReportTo = 99

The Report-To header.

§

ReprDigest = 100

The Repr-Digest header.

§

RetryAfter = 101

The Retry-After header.

§

SaveData = 102

The Save-Data header.

§

SecChUa = 103

The Sec-CH-UA header.

§

SecChUAMobile = 104

The Sec-CH-UA-Mobile header.

§

SecChUAPlatform = 105

The Sec-CH-UA-Platform header.

§

SecFetchDest = 106

The Sec-Fetch-Dest header.

§

SecFetchMode = 107

The Sec-Fetch-Mode header.

§

SecFetchSite = 108

The Sec-Fetch-Site header.

§

SecFetchUser = 109

The Sec-Fetch-User header.

§

SecGpc = 110

The Sec-GPC header.

§

SecWebsocketAccept = 111

§

SecWebsocketExtensions = 112

§

SecWebsocketKey = 113

The Sec-WebSocket-Key header.

§

SecWebsocketProtocol = 114

§

SecWebsocketVersion = 115

§

Server = 116

The Server header.

§

ServerTiming = 117

The Server-Timing header.

§

ServiceWorkerAllowed = 118

§

SetCookie = 119

The Set-Cookie header.

§

SetCookie2 = 120

The Set-Cookie2 header.

§

Signature = 121

The Signature header.

§

SignedHeaders = 122

The Signed-Headers header.

§

Sourcemap = 123

The SourceMap header.

§

StrictTransportSecurity = 124

§

Te = 125

The TE header.

§

TimingAllowOrigin = 126

The Timing-Allow-Origin header.

§

Traceparent = 127

The Traceparent header.

§

Tracestate = 128

The Tracestate header.

§

Trailer = 129

The Trailer header.

§

TransferEncoding = 130

The Transfer-Encoding header.

§

Upgrade = 131

The Upgrade header.

§

UpgradeInsecureRequests = 132

§

UserAgent = 133

The User-Agent header.

§

Vary = 134

The Vary header.

§

Via = 135

The Via header.

§

ViewportWidth = 136

The Viewport-Width header.

§

WwwAuthenticate = 137

The WWW-Authenticate header.

§

WantContentDigest = 138

The Want-Content-Digest header.

§

WantDigest = 139

The Want-Digest header.

§

WantReprDigest = 140

The Want-Repr-Digest header.

§

Warning = 141

The Warning header.

§

Width = 142

The Width header.

§

Xb3Traceid = 143

The X-B3-Traceid header.

§

Xcache = 144

The X-Cache header.

§

XcontentTypeOptions = 145

§

XcorrelationId = 146

The X-Correlation-ID header.

§

XdnsPrefetchControl = 147

§

XdownloadOptions = 148

The X-Download-Options header.

§

XfirefoxSpdy = 149

The X-Firefox-Spdy header.

§

XforwardedBy = 150

The X-Forwarded-By header.

§

XforwardedFor = 151

The X-Forwarded-For header.

§

XforwardedHost = 152

The X-Forwarded-Host header.

§

XforwardedProto = 153

The X-Forwarded-Proto header.

§

XforwardedSsl = 154

The X-Forwarded-SSL header.

§

XframeOptions = 155

The X-Frame-Options header.

§

XpermittedCrossDomainPolicies = 156

§

Xpingback = 157

The X-Pingback header.

§

XpoweredBy = 158

The X-Powered-By header.

§

XrealIp = 159

The X-Real-IP header.

§

XrequestId = 160

The X-Request-Id header.

§

XrequestedWith = 161

The X-Requested-With header.

§

XrobotsTag = 162

The X-Robots-Tag header.

§

Xruntime = 163

The X-Runtime header.

§

XservedBy = 164

The X-Served-By header.

§

XuaCompatible = 165

The X-UA-Compatible header.

§

XxssProtection = 166

The X-XSS-Protection header.

Implementations§

§

impl KnownHeaderName

pub fn as_str(&self) -> &'static str

Retrieve a static string representation of this header name

Trait Implementations§

§

impl AsRef<str> for KnownHeaderName

§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for KnownHeaderName

§

fn clone(&self) -> KnownHeaderName

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
§

impl Debug for KnownHeaderName

§

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

Formats the value using the given formatter. Read more
§

impl Display for KnownHeaderName

§

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

Formats the value using the given formatter. Read more
§

impl From<KnownHeaderName> for HeaderName<'_>

§

fn from(khn: KnownHeaderName) -> HeaderName<'_>

Converts to this type from the input type.
§

impl FromStr for KnownHeaderName

§

type Err = ()

The associated error which can be returned from parsing.
§

fn from_str( s: &str, ) -> Result<KnownHeaderName, <KnownHeaderName as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for KnownHeaderName

§

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

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
§

impl Ord for KnownHeaderName

§

fn cmp(&self, other: &KnownHeaderName) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq<HeaderName<'_>> for KnownHeaderName

§

fn eq(&self, other: &HeaderName<'_>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

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

impl PartialEq<KnownHeaderName> for &HeaderName<'_>

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

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

impl PartialEq<KnownHeaderName> for HeaderName<'_>

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

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

impl PartialEq for KnownHeaderName

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

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

impl PartialOrd for KnownHeaderName

§

fn partial_cmp(&self, other: &KnownHeaderName) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Copy for KnownHeaderName

§

impl Eq for KnownHeaderName

§

impl StructuralPartialEq for KnownHeaderName

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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 T
where T: Clone,

Source§

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 T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.