2424
2525pub  mod  bounds; 
2626pub  mod  erase; 
27+ pub  mod  http_connector; 
28+ pub  mod  never; 
2729pub  mod  retry; 
30+ pub  mod  timeout; 
2831
2932// https://github.com/rust-lang/rust/issues/72081 
3033#[ allow( rustdoc:: private_doc_tests) ]  
@@ -36,8 +39,8 @@ pub mod dvr;
3639#[ cfg( feature = "test-util" ) ]  
3740pub  mod  test_connection; 
3841
39- pub   mod  http_connector ; 
40- 
42+ # [ cfg ( feature =  "client-hyper" ) ] 
43+ pub   mod  conns ; 
4144#[ cfg( feature = "client-hyper" ) ]  
4245pub  mod  hyper_ext; 
4346
@@ -47,78 +50,19 @@ pub mod hyper_ext;
4750#[ doc( hidden) ]  
4851pub  mod  static_tests; 
4952
50- pub  mod  never; 
51- pub  mod  timeout; 
52- pub  use  timeout:: TimeoutLayer ; 
53- 
54- /// Type aliases for standard connection types. 
55- #[ cfg( feature = "client-hyper" ) ]  
56- #[ allow( missing_docs) ]  
57- pub  mod  conns { 
58-     #[ cfg( feature = "rustls" ) ]  
59-     pub  type  Https  = hyper_rustls:: HttpsConnector < hyper:: client:: HttpConnector > ; 
60- 
61-     // Creating a `with_native_roots` HTTP client takes 300ms on OS X. Cache this so that we 
62-     // don't need to repeatedly incur that cost. 
63-     #[ cfg( feature = "rustls" ) ]  
64-     lazy_static:: lazy_static! { 
65-         static  ref HTTPS_NATIVE_ROOTS :  Https  = { 
66-             hyper_rustls:: HttpsConnectorBuilder :: new( ) 
67-                 . with_native_roots( ) 
68-                 . https_or_http( ) 
69-                 . enable_http1( ) 
70-                 . enable_http2( ) 
71-                 . build( ) 
72-         } ; 
73-     } 
74- 
75-     #[ cfg( feature = "rustls" ) ]  
76-     /// Return a default HTTPS connector backed by the `rustls` crate. 
77- /// 
78- /// It requires a minimum TLS version of 1.2. 
79- /// It allows you to connect to both `http` and `https` URLs. 
80- pub  fn  https ( )  -> Https  { 
81-         HTTPS_NATIVE_ROOTS . clone ( ) 
82-     } 
83- 
84-     #[ cfg( feature = "native-tls" ) ]  
85-     /// Return a default HTTPS connector backed by the `hyper_tls` crate. 
86- /// 
87- /// It requires a minimum TLS version of 1.2. 
88- /// It allows you to connect to both `http` and `https` URLs. 
89- pub  fn  native_tls ( )  -> NativeTls  { 
90-         let  mut  tls = hyper_tls:: native_tls:: TlsConnector :: builder ( ) ; 
91-         let  tls = tls
92-             . min_protocol_version ( Some ( hyper_tls:: native_tls:: Protocol :: Tlsv12 ) ) 
93-             . build ( ) 
94-             . unwrap_or_else ( |e| panic ! ( "Error while creating TLS connector: {}" ,  e) ) ; 
95-         let  http = hyper:: client:: HttpConnector :: new ( ) ; 
96-         hyper_tls:: HttpsConnector :: from ( ( http,  tls. into ( ) ) ) 
97-     } 
98- 
99-     #[ cfg( feature = "native-tls" ) ]  
100-     pub  type  NativeTls  = hyper_tls:: HttpsConnector < hyper:: client:: HttpConnector > ; 
101- 
102-     #[ cfg( feature = "rustls" ) ]  
103-     pub  type  Rustls  =
104-         crate :: hyper_ext:: Adapter < hyper_rustls:: HttpsConnector < hyper:: client:: HttpConnector > > ; 
105- } 
106- 
10753use  aws_smithy_async:: rt:: sleep:: AsyncSleep ; 
108- use  aws_smithy_http:: body:: SdkBody ; 
10954use  aws_smithy_http:: operation:: Operation ; 
11055use  aws_smithy_http:: response:: ParseHttpResponse ; 
11156pub  use  aws_smithy_http:: result:: { SdkError ,  SdkSuccess } ; 
112- use  aws_smithy_http:: retry:: ClassifyRetry ; 
11357use  aws_smithy_http_tower:: dispatch:: DispatchLayer ; 
11458use  aws_smithy_http_tower:: parse_response:: ParseResponseLayer ; 
11559use  aws_smithy_types:: error:: display:: DisplayErrorContext ; 
11660use  aws_smithy_types:: retry:: ProvideErrorKind ; 
11761use  aws_smithy_types:: timeout:: OperationTimeoutConfig ; 
118- use  std:: error:: Error ; 
11962use  std:: sync:: Arc ; 
12063use  timeout:: ClientTimeoutParams ; 
121- use  tower:: { Layer ,  Service ,  ServiceBuilder ,  ServiceExt } ; 
64+ pub  use  timeout:: TimeoutLayer ; 
65+ use  tower:: { Service ,  ServiceBuilder ,  ServiceExt } ; 
12266use  tracing:: { debug_span,  field,  field:: display,  Instrument } ; 
12367
12468/// Smithy service client. 
@@ -131,7 +75,7 @@ use tracing::{debug_span, field, field::display, Instrument};
13175/// such as those used for routing (like the URL), authentication, and authorization. 
13276/// 
13377/// The middleware takes the form of a [`tower::Layer`] that wraps the actual connection for each 
134- /// request. The [`tower::Service`] that the middleware produces must accept requests of the type 
78+ /// request. The [`tower::Service`](Service)  that the middleware produces must accept requests of the type 
13579/// [`aws_smithy_http::operation::Request`] and return responses of the type 
13680/// [`http::Response<SdkBody>`], most likely by modifying the provided request in place, passing it 
13781/// to the inner service, and then ultimately returning the inner service's response. 
@@ -165,9 +109,9 @@ impl<C, M> Client<C, M>
165109where 
166110    M :  Default , 
167111{ 
168-     /// Create a Smithy client from the given `connector`, a middleware default, the [standard  
169- /// retry policy](crate:: retry::Standard), and the [`default_async_sleep`](aws_smithy_async::rt::sleep::default_async_sleep)  
170- /// sleep implementation. 
112+     /// Create a Smithy client from the given `connector`, a middleware default, the 
113+ /// [standard  retry policy](retry::Standard), and the 
114+ /// [`default_async_sleep`](aws_smithy_async::rt::sleep::default_async_sleep)  sleep implementation. 
171115pub  fn  new ( connector :  C )  -> Self  { 
172116        Builder :: new ( ) 
173117            . connector ( connector) 
0 commit comments