|
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}; |
20 | 12 |
|
21 |
| -pub use hyper::mime; |
| 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; |
22 | 20 |
|
23 | 21 | /// Type alias to `hyper::Response<'a, hyper::net::Fresh>`.
|
24 |
| -#[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>; |
25 | 23 |
|
26 | 24 | /// Reexported Hyper header types.
|
27 | 25 | pub mod header {
|
28 | 26 | use crate::Header;
|
29 | 27 |
|
30 |
| - use hyper::header::Header as HyperHeaderTrait; |
31 |
| - |
32 | 28 | macro_rules! import_hyper_items {
|
33 | 29 | ($($item:ident),*) => ($(pub use hyper::header::$item;)*)
|
34 | 30 | }
|
35 | 31 |
|
36 | 32 | macro_rules! import_hyper_headers {
|
37 | 33 | ($($name:ident),*) => ($(
|
38 |
| - impl std::convert::From<self::$name> for Header<'static> { |
39 |
| - fn from(header: self::$name) -> Header<'static> { |
40 |
| - Header::new($name::header_name(), header.to_string()) |
41 |
| - } |
42 |
| - } |
| 34 | + pub use http::header::$name as $name; |
43 | 35 | )*)
|
44 | 36 | }
|
45 | 37 |
|
46 |
| - import_hyper_items! { |
47 |
| - Accept, AcceptCharset, AcceptEncoding, AcceptLanguage, AcceptRanges, |
48 |
| - AccessControlAllowCredentials, AccessControlAllowHeaders, |
49 |
| - AccessControlAllowMethods, AccessControlExposeHeaders, |
50 |
| - AccessControlMaxAge, AccessControlRequestHeaders, |
51 |
| - AccessControlRequestMethod, Allow, Authorization, Basic, Bearer, |
52 |
| - CacheControl, Connection, ContentDisposition, ContentEncoding, |
53 |
| - ContentLanguage, ContentLength, ContentRange, ContentType, Date, ETag, |
54 |
| - EntityTag, Expires, From, Headers, Host, HttpDate, IfModifiedSince, |
55 |
| - IfUnmodifiedSince, LastModified, Location, Origin, Prefer, |
56 |
| - PreferenceApplied, Protocol, Quality, QualityItem, Referer, |
57 |
| - StrictTransportSecurity, TransferEncoding, Upgrade, UserAgent, |
58 |
| - AccessControlAllowOrigin, ByteRangeSpec, CacheDirective, Charset, |
59 |
| - ConnectionOption, ContentRangeSpec, DispositionParam, DispositionType, |
60 |
| - Encoding, Expect, IfMatch, IfNoneMatch, IfRange, Pragma, Preference, |
61 |
| - ProtocolName, Range, RangeUnit, ReferrerPolicy, Vary, Scheme, q, qitem |
62 |
| - } |
63 |
| - |
| 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 | +// |
64 | 56 | import_hyper_headers! {
|
65 |
| - Accept, AccessControlAllowCredentials, AccessControlAllowHeaders, |
66 |
| - AccessControlAllowMethods, AccessControlAllowOrigin, |
67 |
| - AccessControlExposeHeaders, AccessControlMaxAge, |
68 |
| - AccessControlRequestHeaders, AccessControlRequestMethod, AcceptCharset, |
69 |
| - AcceptEncoding, AcceptLanguage, AcceptRanges, Allow, CacheControl, |
70 |
| - Connection, ContentDisposition, ContentEncoding, ContentLanguage, |
71 |
| - ContentLength, ContentRange, Date, ETag, Expect, Expires, Host, IfMatch, |
72 |
| - IfModifiedSince, IfNoneMatch, IfRange, IfUnmodifiedSince, LastModified, |
73 |
| - Location, Origin, Pragma, Prefer, PreferenceApplied, Range, Referer, |
74 |
| - ReferrerPolicy, StrictTransportSecurity, TransferEncoding, Upgrade, |
75 |
| - 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 |
76 | 68 | }
|
77 | 69 | }
|
0 commit comments