Skip to main content

KnownHeaderName

Enum KnownHeaderName 

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

§

Authorization = 23

The Authorization header.

§

CacheControl = 24

The Cache-Control header.

§

ClearSiteData = 25

The Clear-Site-Data header.

§

Connection = 26

The Connection header.

§

ContentDpr = 27

The Content-DPR header.

§

ContentDigest = 28

The Content-Digest header.

§

ContentDisposition = 29

The Content-Disposition header.

§

ContentEncoding = 30

The Content-Encoding header.

§

ContentLanguage = 31

The Content-Language header.

§

ContentLength = 32

The Content-Length header.

§

ContentLocation = 33

The Content-Location header.

§

ContentRange = 34

The Content-Range header.

§

ContentSecurityPolicy = 35

§

ContentSecurityPolicyReportOnly = 36

§

ContentType = 37

The Content-Type header.

§

Cookie = 38

The Cookie header.

§

Cookie2 = 39

The Cookie2 header.

§

CrossOriginEmbedderPolicy = 40

§

CrossOriginOpenerPolicy = 41

§

CrossOriginResourcePolicy = 42

§

Dnt = 43

The DNT header.

§

Dpr = 44

The DPR header.

§

Dpop = 45

The DPoP header.

§

Deprecation = 46

The Deprecation header.

§

DeviceMemory = 47

The Device-Memory header.

§

Digest = 48

The Digest header.

The Downlink header.

§

Ect = 50

The ECT header.

§

Etag = 51

The ETag header.

§

EarlyData = 52

The Early-Data header.

§

Expect = 53

The Expect header.

§

ExpectCt = 54

The Expect-CT header.

§

Expires = 55

The Expires header.

§

FeaturePolicy = 56

The Feature-Policy header.

§

Forwarded = 57

The Forwarded header.

§

From = 58

The From header.

§

IfMatch = 59

The If-Match header.

§

IfModifiedSince = 60

The If-Modified-Since header.

§

IfNoneMatch = 61

The If-None-Match header.

§

IfRange = 62

The If-Range header.

§

IfUnmodifiedSince = 63

The If-Unmodified-Since header.

§

KeepAlive = 64

The Keep-Alive header.

§

LargeAllocation = 65

The Large-Allocation header.

§

LastEventId = 66

The Last-Event-ID header.

§

LastModified = 67

The Last-Modified header.

The Link header.

§

Location = 69

The Location header.

§

MaxForwards = 70

The Max-Forwards header.

§

Nel = 71

The NEL header.

§

Origin = 72

The Origin header.

§

OriginIsolation = 73

The Origin-Isolation header.

§

PermissionsPolicy = 74

The Permissions-Policy header.

§

PingFrom = 75

The Ping-From header.

§

PingTo = 76

The Ping-To header.

§

Pragma = 77

The Pragma header.

§

Priority = 78

The Priority header.

§

ProxyAuthenticate = 79

The Proxy-Authenticate header.

§

ProxyAuthorization = 80

The Proxy-Authorization header.

§

ProxyConnection = 81

The Proxy-Connection header.

§

ProxyStatus = 82

The Proxy-Status header.

§

PublicKeyPins = 83

The Public-Key-Pins header.

§

PublicKeyPinsReportOnly = 84

§

Purpose = 85

The Purpose header.

§

PushPolicy = 86

The Push-Policy header.

§

Rtt = 87

The RTT header.

§

Range = 88

The Range header.

§

RatelimitReset = 89

The RateLimit-Reset header.

§

RatelimitLimit = 90

The Ratelimit-Limit header.

§

RatelimitRemaining = 91

The Ratelimit-Remaining header.

§

Referer = 92

The Referer header.

§

ReferrerPolicy = 93

The Referrer-Policy header.

§

RefreshCache = 94

The Refresh-Cache header.

§

ReportTo = 95

The Report-To header.

§

ReprDigest = 96

The Repr-Digest header.

§

RetryAfter = 97

The Retry-After header.

§

SaveData = 98

The Save-Data header.

§

SecChUa = 99

The Sec-CH-UA header.

§

SecChUAMobile = 100

The Sec-CH-UA-Mobile header.

§

SecChUAPlatform = 101

The Sec-CH-UA-Platform header.

§

SecFetchDest = 102

The Sec-Fetch-Dest header.

§

SecFetchMode = 103

The Sec-Fetch-Mode header.

§

SecFetchSite = 104

The Sec-Fetch-Site header.

§

SecFetchUser = 105

The Sec-Fetch-User header.

§

SecGpc = 106

The Sec-GPC header.

§

SecWebsocketAccept = 107

§

SecWebsocketExtensions = 108

§

SecWebsocketKey = 109

The Sec-WebSocket-Key header.

§

SecWebsocketProtocol = 110

§

SecWebsocketVersion = 111

§

Server = 112

The Server header.

§

ServerTiming = 113

The Server-Timing header.

§

ServiceWorkerAllowed = 114

§

SetCookie = 115

The Set-Cookie header.

§

SetCookie2 = 116

The Set-Cookie2 header.

§

Signature = 117

The Signature header.

§

SignedHeaders = 118

The Signed-Headers header.

§

Sourcemap = 119

The SourceMap header.

§

StrictTransportSecurity = 120

§

Te = 121

The TE header.

§

TimingAllowOrigin = 122

The Timing-Allow-Origin header.

§

Traceparent = 123

The Traceparent header.

§

Tracestate = 124

The Tracestate header.

§

Trailer = 125

The Trailer header.

§

TransferEncoding = 126

The Transfer-Encoding header.

§

Upgrade = 127

The Upgrade header.

§

UpgradeInsecureRequests = 128

§

UserAgent = 129

The User-Agent header.

§

Vary = 130

The Vary header.

§

Via = 131

The Via header.

§

ViewportWidth = 132

The Viewport-Width header.

§

WwwAuthenticate = 133

The WWW-Authenticate header.

§

WantContentDigest = 134

The Want-Content-Digest header.

§

WantDigest = 135

The Want-Digest header.

§

WantReprDigest = 136

The Want-Repr-Digest header.

§

Warning = 137

The Warning header.

§

Width = 138

The Width header.

§

Xb3Traceid = 139

The X-B3-Traceid header.

§

Xcache = 140

The X-Cache header.

§

XcontentTypeOptions = 141

§

XcorrelationId = 142

The X-Correlation-ID header.

§

XdnsPrefetchControl = 143

§

XdownloadOptions = 144

The X-Download-Options header.

§

XfirefoxSpdy = 145

The X-Firefox-Spdy header.

§

XforwardedBy = 146

The X-Forwarded-By header.

§

XforwardedFor = 147

The X-Forwarded-For header.

§

XforwardedHost = 148

The X-Forwarded-Host header.

§

XforwardedProto = 149

The X-Forwarded-Proto header.

§

XforwardedSsl = 150

The X-Forwarded-SSL header.

§

XframeOptions = 151

The X-Frame-Options header.

§

XpermittedCrossDomainPolicies = 152

§

Xpingback = 153

The X-Pingback header.

§

XpoweredBy = 154

The X-Powered-By header.

§

XrealIp = 155

The X-Real-IP header.

§

XrequestId = 156

The X-Request-Id header.

§

XrequestedWith = 157

The X-Requested-With header.

§

XrobotsTag = 158

The X-Robots-Tag header.

§

Xruntime = 159

The X-Runtime header.

§

XservedBy = 160

The X-Served-By header.

§

XuaCompatible = 161

The X-UA-Compatible header.

§

XxssProtection = 162

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