Skip to main content

KnownHeaderName

Enum KnownHeaderName 

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

§

ClearSiteData = 26

The Clear-Site-Data header.

§

Connection = 27

The Connection header.

§

ContentDpr = 28

The Content-DPR header.

§

ContentDigest = 29

The Content-Digest header.

§

ContentDisposition = 30

The Content-Disposition header.

§

ContentEncoding = 31

The Content-Encoding header.

§

ContentLanguage = 32

The Content-Language header.

§

ContentLength = 33

The Content-Length header.

§

ContentLocation = 34

The Content-Location header.

§

ContentRange = 35

The Content-Range header.

§

ContentSecurityPolicy = 36

§

ContentSecurityPolicyReportOnly = 37

§

ContentType = 38

The Content-Type header.

§

Cookie = 39

The Cookie header.

§

Cookie2 = 40

The Cookie2 header.

§

CrossOriginEmbedderPolicy = 41

§

CrossOriginOpenerPolicy = 42

§

CrossOriginResourcePolicy = 43

§

Dnt = 44

The DNT header.

§

Dpr = 45

The DPR header.

§

Dpop = 46

The DPoP header.

§

Deprecation = 47

The Deprecation header.

§

DeviceMemory = 48

The Device-Memory header.

§

Digest = 49

The Digest header.

The Downlink header.

§

Ect = 51

The ECT header.

§

Etag = 52

The ETag header.

§

EarlyData = 53

The Early-Data header.

§

Expect = 54

The Expect header.

§

ExpectCt = 55

The Expect-CT header.

§

Expires = 56

The Expires header.

§

FeaturePolicy = 57

The Feature-Policy header.

§

Forwarded = 58

The Forwarded header.

§

From = 59

The From header.

§

IfMatch = 60

The If-Match header.

§

IfModifiedSince = 61

The If-Modified-Since header.

§

IfNoneMatch = 62

The If-None-Match header.

§

IfRange = 63

The If-Range header.

§

IfUnmodifiedSince = 64

The If-Unmodified-Since header.

§

KeepAlive = 65

The Keep-Alive header.

§

LargeAllocation = 66

The Large-Allocation header.

§

LastEventId = 67

The Last-Event-ID header.

§

LastModified = 68

The Last-Modified header.

The Link header.

§

Location = 70

The Location header.

§

MaxForwards = 71

The Max-Forwards header.

§

Nel = 72

The NEL header.

§

Origin = 73

The Origin header.

§

OriginIsolation = 74

The Origin-Isolation header.

§

PermissionsPolicy = 75

The Permissions-Policy header.

§

PingFrom = 76

The Ping-From header.

§

PingTo = 77

The Ping-To header.

§

Pragma = 78

The Pragma header.

§

Priority = 79

The Priority header.

§

ProxyAuthenticate = 80

The Proxy-Authenticate header.

§

ProxyAuthenticationInfo = 81

§

ProxyAuthorization = 82

The Proxy-Authorization header.

§

ProxyConnection = 83

The Proxy-Connection header.

§

ProxyStatus = 84

The Proxy-Status header.

§

PublicKeyPins = 85

The Public-Key-Pins header.

§

PublicKeyPinsReportOnly = 86

§

Purpose = 87

The Purpose header.

§

PushPolicy = 88

The Push-Policy header.

§

Rtt = 89

The RTT header.

§

Range = 90

The Range header.

§

RatelimitReset = 91

The RateLimit-Reset header.

§

RatelimitLimit = 92

The Ratelimit-Limit header.

§

RatelimitRemaining = 93

The Ratelimit-Remaining header.

§

Referer = 94

The Referer header.

§

ReferrerPolicy = 95

The Referrer-Policy header.

§

Refresh = 96

The Refresh header.

§

RefreshCache = 97

The Refresh-Cache header.

§

ReportTo = 98

The Report-To header.

§

ReprDigest = 99

The Repr-Digest header.

§

RetryAfter = 100

The Retry-After header.

§

SaveData = 101

The Save-Data header.

§

SecChUa = 102

The Sec-CH-UA header.

§

SecChUAMobile = 103

The Sec-CH-UA-Mobile header.

§

SecChUAPlatform = 104

The Sec-CH-UA-Platform header.

§

SecFetchDest = 105

The Sec-Fetch-Dest header.

§

SecFetchMode = 106

The Sec-Fetch-Mode header.

§

SecFetchSite = 107

The Sec-Fetch-Site header.

§

SecFetchUser = 108

The Sec-Fetch-User header.

§

SecGpc = 109

The Sec-GPC header.

§

SecWebsocketAccept = 110

§

SecWebsocketExtensions = 111

§

SecWebsocketKey = 112

The Sec-WebSocket-Key header.

§

SecWebsocketProtocol = 113

§

SecWebsocketVersion = 114

§

Server = 115

The Server header.

§

ServerTiming = 116

The Server-Timing header.

§

ServiceWorkerAllowed = 117

§

SetCookie = 118

The Set-Cookie header.

§

SetCookie2 = 119

The Set-Cookie2 header.

§

Signature = 120

The Signature header.

§

SignedHeaders = 121

The Signed-Headers header.

§

Sourcemap = 122

The SourceMap header.

§

StrictTransportSecurity = 123

§

Te = 124

The TE header.

§

TimingAllowOrigin = 125

The Timing-Allow-Origin header.

§

Traceparent = 126

The Traceparent header.

§

Tracestate = 127

The Tracestate header.

§

Trailer = 128

The Trailer header.

§

TransferEncoding = 129

The Transfer-Encoding header.

§

Upgrade = 130

The Upgrade header.

§

UpgradeInsecureRequests = 131

§

UserAgent = 132

The User-Agent header.

§

Vary = 133

The Vary header.

§

Via = 134

The Via header.

§

ViewportWidth = 135

The Viewport-Width header.

§

WwwAuthenticate = 136

The WWW-Authenticate header.

§

WantContentDigest = 137

The Want-Content-Digest header.

§

WantDigest = 138

The Want-Digest header.

§

WantReprDigest = 139

The Want-Repr-Digest header.

§

Warning = 140

The Warning header.

§

Width = 141

The Width header.

§

Xb3Traceid = 142

The X-B3-Traceid header.

§

Xcache = 143

The X-Cache header.

§

XcontentTypeOptions = 144

§

XcorrelationId = 145

The X-Correlation-ID header.

§

XdnsPrefetchControl = 146

§

XdownloadOptions = 147

The X-Download-Options header.

§

XfirefoxSpdy = 148

The X-Firefox-Spdy header.

§

XforwardedBy = 149

The X-Forwarded-By header.

§

XforwardedFor = 150

The X-Forwarded-For header.

§

XforwardedHost = 151

The X-Forwarded-Host header.

§

XforwardedProto = 152

The X-Forwarded-Proto header.

§

XforwardedSsl = 153

The X-Forwarded-SSL header.

§

XframeOptions = 154

The X-Frame-Options header.

§

XpermittedCrossDomainPolicies = 155

§

Xpingback = 156

The X-Pingback header.

§

XpoweredBy = 157

The X-Powered-By header.

§

XrealIp = 158

The X-Real-IP header.

§

XrequestId = 159

The X-Request-Id header.

§

XrequestedWith = 160

The X-Requested-With header.

§

XrobotsTag = 161

The X-Robots-Tag header.

§

Xruntime = 162

The X-Runtime header.

§

XservedBy = 163

The X-Served-By header.

§

XuaCompatible = 164

The X-UA-Compatible header.

§

XxssProtection = 165

The X-XSS-Protection header.

Implementations§

Source§

impl KnownHeaderName

Source

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

Retrieve a static string representation of this header name

Trait Implementations§

Source§

impl AsRef<str> for KnownHeaderName

Source§

fn as_ref(&self) -> &str

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

impl Clone for KnownHeaderName

Source§

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
Source§

impl Debug for KnownHeaderName

Source§

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

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

impl Display for KnownHeaderName

Source§

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

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

impl From<KnownHeaderName> for HeaderName<'_>

Source§

fn from(khn: KnownHeaderName) -> Self

Converts to this type from the input type.
Source§

impl FromStr for KnownHeaderName

Source§

type Err = ()

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

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

impl Hash for KnownHeaderName

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 Ord for KnownHeaderName

Source§

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
Source§

impl PartialEq<HeaderName<'_>> for KnownHeaderName

Source§

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.
Source§

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

Source§

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.
Source§

impl PartialEq<KnownHeaderName> for HeaderName<'_>

Source§

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.
Source§

impl PartialEq for KnownHeaderName

Source§

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.
Source§

impl PartialOrd for KnownHeaderName

Source§

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
Source§

impl Copy for KnownHeaderName

Source§

impl Eq for KnownHeaderName

Source§

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.