|
4 | 4 | //! These types will, with certainty, be removed with time, but they reside here |
5 | 5 | //! while necessary. |
6 | 6 |
|
7 | | -#[doc(hidden)] pub use hyper::server::Request as Request; |
8 | | -#[doc(hidden)] pub use hyper::server::Response as Response; |
9 | | -#[doc(hidden)] pub use hyper::server::Server as Server; |
10 | | -#[doc(hidden)] pub use hyper::server::Handler as Handler; |
11 | | - |
12 | | -#[doc(hidden)] pub use hyper::net; |
13 | | - |
14 | | -#[doc(hidden)] pub use hyper::method::Method; |
15 | | -#[doc(hidden)] pub use hyper::status::StatusCode; |
| 7 | +#[doc(hidden)] pub use hyper::{Body, Request, Response}; |
| 8 | +#[doc(hidden)] pub use hyper::body::Payload as Payload; |
16 | 9 | #[doc(hidden)] pub use hyper::error::Error; |
17 | | -#[doc(hidden)] pub use hyper::uri::RequestUri; |
18 | | -#[doc(hidden)] pub use hyper::http::h1; |
19 | | -#[doc(hidden)] pub use hyper::buffer; |
| 10 | +#[doc(hidden)] pub use hyper::server::Server; |
| 11 | +#[doc(hidden)] pub use hyper::service::{MakeService, Service}; |
| 12 | + |
| 13 | +#[doc(hidden)] pub use hyper::Chunk; |
| 14 | +#[doc(hidden)] pub use http::header::HeaderName as HeaderName; |
| 15 | +#[doc(hidden)] pub use http::header::HeaderValue as HeaderValue; |
| 16 | +#[doc(hidden)] pub use http::method::Method; |
| 17 | +#[doc(hidden)] pub use http::request::Parts; |
| 18 | +#[doc(hidden)] pub use http::status::StatusCode; |
| 19 | +#[doc(hidden)] pub use http::uri::Uri; |
20 | 20 |
|
21 | 21 | /// Type alias to `hyper::Response<'a, hyper::net::Fresh>`. |
22 | | -#[doc(hidden)] pub type FreshResponse<'a> = self::Response<'a, self::net::Fresh>; |
| 22 | +// TODO #[doc(hidden)] pub type FreshResponse<'a> = self::Response<'a, self::net::Fresh>; |
23 | 23 |
|
24 | 24 | /// Reexported Hyper header types. |
25 | 25 | pub mod header { |
26 | 26 | use crate::Header; |
27 | 27 |
|
28 | | - use hyper::header::Header as HyperHeaderTrait; |
29 | | - |
30 | 28 | macro_rules! import_hyper_items { |
31 | 29 | ($($item:ident),*) => ($(pub use hyper::header::$item;)*) |
32 | 30 | } |
33 | 31 |
|
34 | 32 | macro_rules! import_hyper_headers { |
35 | 33 | ($($name:ident),*) => ($( |
36 | | - impl std::convert::From<self::$name> for Header<'static> { |
37 | | - fn from(header: self::$name) -> Header<'static> { |
38 | | - Header::new($name::header_name(), header.to_string()) |
39 | | - } |
40 | | - } |
| 34 | + pub use http::header::$name as $name; |
41 | 35 | )*) |
42 | 36 | } |
43 | 37 |
|
44 | | - import_hyper_items! { |
45 | | - Accept, AcceptCharset, AcceptEncoding, AcceptLanguage, AcceptRanges, |
46 | | - AccessControlAllowCredentials, AccessControlAllowHeaders, |
47 | | - AccessControlAllowMethods, AccessControlExposeHeaders, |
48 | | - AccessControlMaxAge, AccessControlRequestHeaders, |
49 | | - AccessControlRequestMethod, Allow, Authorization, Basic, Bearer, |
50 | | - CacheControl, Connection, ContentDisposition, ContentEncoding, |
51 | | - ContentLanguage, ContentLength, ContentRange, ContentType, Date, ETag, |
52 | | - EntityTag, Expires, From, Headers, Host, HttpDate, IfModifiedSince, |
53 | | - IfUnmodifiedSince, LastModified, Location, Origin, Prefer, |
54 | | - PreferenceApplied, Protocol, Quality, QualityItem, Referer, |
55 | | - StrictTransportSecurity, TransferEncoding, Upgrade, UserAgent, |
56 | | - AccessControlAllowOrigin, ByteRangeSpec, CacheDirective, Charset, |
57 | | - ConnectionOption, ContentRangeSpec, DispositionParam, DispositionType, |
58 | | - Encoding, Expect, IfMatch, IfNoneMatch, IfRange, Pragma, Preference, |
59 | | - ProtocolName, Range, RangeUnit, ReferrerPolicy, Vary, Scheme, q, qitem |
60 | | - } |
61 | | - |
| 38 | +// import_hyper_items! { |
| 39 | +// Accept, AcceptCharset, AcceptEncoding, AcceptLanguage, AcceptRanges, |
| 40 | +// AccessControlAllowCredentials, AccessControlAllowHeaders, |
| 41 | +// AccessControlAllowMethods, AccessControlExposeHeaders, |
| 42 | +// AccessControlMaxAge, AccessControlRequestHeaders, |
| 43 | +// AccessControlRequestMethod, Allow, Authorization, Basic, Bearer, |
| 44 | +// CacheControl, Connection, ContentDisposition, ContentEncoding, |
| 45 | +// ContentLanguage, ContentLength, ContentRange, ContentType, Date, ETag, |
| 46 | +// EntityTag, Expires, From, Headers, Host, HttpDate, IfModifiedSince, |
| 47 | +// IfUnmodifiedSince, LastModified, Location, Origin, Prefer, |
| 48 | +// PreferenceApplied, Protocol, Quality, QualityItem, Referer, |
| 49 | +// StrictTransportSecurity, TransferEncoding, Upgrade, UserAgent, |
| 50 | +// AccessControlAllowOrigin, ByteRangeSpec, CacheDirective, Charset, |
| 51 | +// ConnectionOption, ContentRangeSpec, DispositionParam, DispositionType, |
| 52 | +// Encoding, Expect, IfMatch, IfNoneMatch, IfRange, Pragma, Preference, |
| 53 | +// ProtocolName, Range, RangeUnit, ReferrerPolicy, Vary, Scheme, q, qitem |
| 54 | +// } |
| 55 | +// |
62 | 56 | import_hyper_headers! { |
63 | | - Accept, AccessControlAllowCredentials, AccessControlAllowHeaders, |
64 | | - AccessControlAllowMethods, AccessControlAllowOrigin, |
65 | | - AccessControlExposeHeaders, AccessControlMaxAge, |
66 | | - AccessControlRequestHeaders, AccessControlRequestMethod, AcceptCharset, |
67 | | - AcceptEncoding, AcceptLanguage, AcceptRanges, Allow, CacheControl, |
68 | | - Connection, ContentDisposition, ContentEncoding, ContentLanguage, |
69 | | - ContentLength, ContentRange, Date, ETag, Expect, Expires, Host, IfMatch, |
70 | | - IfModifiedSince, IfNoneMatch, IfRange, IfUnmodifiedSince, LastModified, |
71 | | - Location, Origin, Pragma, Prefer, PreferenceApplied, Range, Referer, |
72 | | - ReferrerPolicy, StrictTransportSecurity, TransferEncoding, Upgrade, |
73 | | - UserAgent, Vary |
| 57 | + ACCEPT, ACCESS_CONTROL_ALLOW_CREDENTIALS, ACCESS_CONTROL_ALLOW_HEADERS, |
| 58 | + ACCESS_CONTROL_ALLOW_METHODS, ACCESS_CONTROL_ALLOW_ORIGIN, |
| 59 | + ACCESS_CONTROL_EXPOSE_HEADERS, ACCESS_CONTROL_MAX_AGE, |
| 60 | + ACCESS_CONTROL_REQUEST_HEADERS, ACCESS_CONTROL_REQUEST_METHOD, ACCEPT_CHARSET, |
| 61 | + ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_RANGES, ALLOW, CACHE_CONTROL, |
| 62 | + CONNECTION, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, |
| 63 | + CONTENT_LENGTH, CONTENT_RANGE, DATE, ETAG, EXPECT, EXPIRES, HOST, IF_MATCH, |
| 64 | + IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, |
| 65 | + LOCATION, ORIGIN, PRAGMA, RANGE, REFERER, |
| 66 | + REFERRER_POLICY, STRICT_TRANSPORT_SECURITY, TRANSFER_ENCODING, UPGRADE, |
| 67 | + USER_AGENT, VARY |
74 | 68 | } |
75 | 69 | } |
0 commit comments