Skip to main content

KnownHeaderName

Enum KnownHeaderName 

#[non_exhaustive]
#[repr(u8)]
pub enum KnownHeaderName {
Show 165 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, RefreshCache = 96, ReportTo = 97, ReprDigest = 98, RetryAfter = 99, SaveData = 100, SecChUa = 101, SecChUAMobile = 102, SecChUAPlatform = 103, SecFetchDest = 104, SecFetchMode = 105, SecFetchSite = 106, SecFetchUser = 107, SecGpc = 108, SecWebsocketAccept = 109, SecWebsocketExtensions = 110, SecWebsocketKey = 111, SecWebsocketProtocol = 112, SecWebsocketVersion = 113, Server = 114, ServerTiming = 115, ServiceWorkerAllowed = 116, SetCookie = 117, SetCookie2 = 118, Signature = 119, SignedHeaders = 120, Sourcemap = 121, StrictTransportSecurity = 122, Te = 123, TimingAllowOrigin = 124, Traceparent = 125, Tracestate = 126, Trailer = 127, TransferEncoding = 128, Upgrade = 129, UpgradeInsecureRequests = 130, UserAgent = 131, Vary = 132, Via = 133, ViewportWidth = 134, WwwAuthenticate = 135, WantContentDigest = 136, WantDigest = 137, WantReprDigest = 138, Warning = 139, Width = 140, Xb3Traceid = 141, Xcache = 142, XcontentTypeOptions = 143, XcorrelationId = 144, XdnsPrefetchControl = 145, XdownloadOptions = 146, XfirefoxSpdy = 147, XforwardedBy = 148, XforwardedFor = 149, XforwardedHost = 150, XforwardedProto = 151, XforwardedSsl = 152, XframeOptions = 153, XpermittedCrossDomainPolicies = 154, Xpingback = 155, XpoweredBy = 156, XrealIp = 157, XrequestId = 158, XrequestedWith = 159, XrobotsTag = 160, Xruntime = 161, XservedBy = 162, XuaCompatible = 163, XxssProtection = 164,
}
Expand description

A short nonehaustive enum of headers that trillium can represent as a u8. Use a KnownHeaderName variant instead of a &’static str anywhere possible, as it allows trillium to skip parsing the header entirely.

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.

§

RefreshCache = 96

The Refresh-Cache header.

§

ReportTo = 97

The Report-To header.

§

ReprDigest = 98

The Repr-Digest header.

§

RetryAfter = 99

The Retry-After header.

§

SaveData = 100

The Save-Data header.

§

SecChUa = 101

The Sec-CH-UA header.

§

SecChUAMobile = 102

The Sec-CH-UA-Mobile header.

§

SecChUAPlatform = 103

The Sec-CH-UA-Platform header.

§

SecFetchDest = 104

The Sec-Fetch-Dest header.

§

SecFetchMode = 105

The Sec-Fetch-Mode header.

§

SecFetchSite = 106

The Sec-Fetch-Site header.

§

SecFetchUser = 107

The Sec-Fetch-User header.

§

SecGpc = 108

The Sec-GPC header.

§

SecWebsocketAccept = 109

§

SecWebsocketExtensions = 110

§

SecWebsocketKey = 111

The Sec-WebSocket-Key header.

§

SecWebsocketProtocol = 112

§

SecWebsocketVersion = 113

§

Server = 114

The Server header.

§

ServerTiming = 115

The Server-Timing header.

§

ServiceWorkerAllowed = 116

§

SetCookie = 117

The Set-Cookie header.

§

SetCookie2 = 118

The Set-Cookie2 header.

§

Signature = 119

The Signature header.

§

SignedHeaders = 120

The Signed-Headers header.

§

Sourcemap = 121

The SourceMap header.

§

StrictTransportSecurity = 122

§

Te = 123

The TE header.

§

TimingAllowOrigin = 124

The Timing-Allow-Origin header.

§

Traceparent = 125

The Traceparent header.

§

Tracestate = 126

The Tracestate header.

§

Trailer = 127

The Trailer header.

§

TransferEncoding = 128

The Transfer-Encoding header.

§

Upgrade = 129

The Upgrade header.

§

UpgradeInsecureRequests = 130

§

UserAgent = 131

The User-Agent header.

§

Vary = 132

The Vary header.

§

Via = 133

The Via header.

§

ViewportWidth = 134

The Viewport-Width header.

§

WwwAuthenticate = 135

The WWW-Authenticate header.

§

WantContentDigest = 136

The Want-Content-Digest header.

§

WantDigest = 137

The Want-Digest header.

§

WantReprDigest = 138

The Want-Repr-Digest header.

§

Warning = 139

The Warning header.

§

Width = 140

The Width header.

§

Xb3Traceid = 141

The X-B3-Traceid header.

§

Xcache = 142

The X-Cache header.

§

XcontentTypeOptions = 143

§

XcorrelationId = 144

The X-Correlation-ID header.

§

XdnsPrefetchControl = 145

§

XdownloadOptions = 146

The X-Download-Options header.

§

XfirefoxSpdy = 147

The X-Firefox-Spdy header.

§

XforwardedBy = 148

The X-Forwarded-By header.

§

XforwardedFor = 149

The X-Forwarded-For header.

§

XforwardedHost = 150

The X-Forwarded-Host header.

§

XforwardedProto = 151

The X-Forwarded-Proto header.

§

XforwardedSsl = 152

The X-Forwarded-SSL header.

§

XframeOptions = 153

The X-Frame-Options header.

§

XpermittedCrossDomainPolicies = 154

§

Xpingback = 155

The X-Pingback header.

§

XpoweredBy = 156

The X-Powered-By header.

§

XrealIp = 157

The X-Real-IP header.

§

XrequestId = 158

The X-Request-Id header.

§

XrequestedWith = 159

The X-Requested-With header.

§

XrobotsTag = 160

The X-Robots-Tag header.

§

Xruntime = 161

The X-Runtime header.

§

XservedBy = 162

The X-Served-By header.

§

XuaCompatible = 163

The X-UA-Compatible header.

§

XxssProtection = 164

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

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

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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.