headers_accept_encoding/common/
mod.rs1pub use self::accept_encoding::AcceptEncoding;
11pub use self::accept_ranges::AcceptRanges;
13pub use self::access_control_allow_credentials::AccessControlAllowCredentials;
15pub use self::access_control_allow_headers::AccessControlAllowHeaders;
16pub use self::access_control_allow_methods::AccessControlAllowMethods;
17pub use self::access_control_allow_origin::AccessControlAllowOrigin;
18pub use self::access_control_expose_headers::AccessControlExposeHeaders;
19pub use self::access_control_max_age::AccessControlMaxAge;
20pub use self::access_control_request_headers::AccessControlRequestHeaders;
21pub use self::access_control_request_method::AccessControlRequestMethod;
22pub use self::age::Age;
23pub use self::allow::Allow;
24pub use self::authorization::Authorization;
25pub use self::cache_control::CacheControl;
26pub use self::connection::Connection;
27pub use self::content_coding::ContentCoding;
28pub use self::content_disposition::ContentDisposition;
29pub use self::content_encoding::ContentEncoding;
30pub use self::content_length::ContentLength;
32pub use self::content_location::ContentLocation;
33pub use self::content_range::ContentRange;
34pub use self::content_type::ContentType;
35pub use self::cookie::Cookie;
36pub use self::date::Date;
37pub use self::etag::ETag;
38pub use self::expect::Expect;
39pub use self::expires::Expires;
40pub use self::host::Host;
42pub use self::if_match::IfMatch;
43pub use self::if_modified_since::IfModifiedSince;
44pub use self::if_none_match::IfNoneMatch;
45pub use self::if_range::IfRange;
46pub use self::if_unmodified_since::IfUnmodifiedSince;
47pub use self::last_modified::LastModified;
49pub use self::location::Location;
51pub use self::origin::Origin;
52pub use self::pragma::Pragma;
53pub use self::proxy_authorization::ProxyAuthorization;
56pub use self::range::Range;
57pub use self::referer::Referer;
58pub use self::referrer_policy::ReferrerPolicy;
59pub use self::retry_after::RetryAfter;
60pub use self::sec_websocket_accept::SecWebsocketAccept;
61pub use self::sec_websocket_key::SecWebsocketKey;
62pub use self::sec_websocket_version::SecWebsocketVersion;
63pub use self::server::Server;
64pub use self::set_cookie::SetCookie;
65pub use self::strict_transport_security::StrictTransportSecurity;
66pub use self::te::Te;
67pub use self::transfer_encoding::TransferEncoding;
68pub use self::upgrade::Upgrade;
69pub use self::user_agent::UserAgent;
70pub use self::vary::Vary;
71#[cfg(test)]
74fn test_decode<T: ::Header>(values: &[&str]) -> Option<T> {
75 use HeaderMapExt;
76 let mut map = ::http::HeaderMap::new();
77 for val in values {
78 map.append(T::name(), val.parse().unwrap());
79 }
80 map.typed_get()
81}
82
83#[cfg(test)]
84fn test_encode<T: ::Header>(header: T) -> ::http::HeaderMap {
85 use HeaderMapExt;
86 let mut map = ::http::HeaderMap::new();
87 map.typed_insert(header);
88 map
89}
90
91#[cfg(test)]
92macro_rules! bench_header {
93 ($mod:ident, $ty:ident, $value:expr) => {
94 #[cfg(feature = "nightly")]
95 mod $mod {
96 use super::$ty;
97 use HeaderMapExt;
98
99 #[bench]
100 fn bench_decode(b: &mut ::test::Bencher) {
101 let mut map = ::http::HeaderMap::new();
102 map.append(
103 <$ty as ::Header>::name(),
104 $value.parse().expect("HeaderValue::from_str($value)"),
105 );
106 b.bytes = $value.len() as u64;
107 b.iter(|| {
108 map.typed_get::<$ty>().unwrap();
109 });
110 }
111
112 #[bench]
113 fn bench_encode(b: &mut ::test::Bencher) {
114 let mut map = ::http::HeaderMap::new();
115 map.append(
116 <$ty as ::Header>::name(),
117 $value.parse().expect("HeaderValue::from_str($value)"),
118 );
119 let typed = map.typed_get::<$ty>().unwrap();
120 b.bytes = $value.len() as u64;
121 b.iter(|| {
122 map.typed_insert(typed.clone());
123 map.clear();
124 });
125 }
126 }
127 };
128}
129
130mod accept_encoding;
133mod accept_ranges;
135mod access_control_allow_credentials;
136mod access_control_allow_headers;
137mod access_control_allow_methods;
138mod access_control_allow_origin;
139mod access_control_expose_headers;
140mod access_control_max_age;
141mod access_control_request_headers;
142mod access_control_request_method;
143mod age;
144mod allow;
145pub mod authorization;
146mod cache_control;
147mod connection;
148mod content_coding;
149mod content_disposition;
150mod content_encoding;
151mod content_length;
153mod content_location;
154mod content_range;
155mod content_type;
156mod cookie;
157mod date;
158mod etag;
159mod expect;
160mod expires;
161mod host;
163mod if_match;
164mod if_modified_since;
165mod if_none_match;
166mod if_range;
167mod if_unmodified_since;
168mod last_modified;
170mod location;
172mod origin;
173mod pragma;
174mod proxy_authorization;
177mod range;
178mod referer;
179mod referrer_policy;
180mod retry_after;
181mod sec_websocket_accept;
182mod sec_websocket_key;
183mod sec_websocket_version;
184mod server;
185mod set_cookie;
186mod strict_transport_security;
187mod te;
188mod transfer_encoding;
189mod upgrade;
190mod user_agent;
191mod vary;
192