@@ -306,26 +306,32 @@ pub trait RestPath<T> {
306
306
fn get_path ( par : T ) -> Result < String , Error > ;
307
307
}
308
308
309
- impl < R > RestClient < R >
310
- where
311
- R : Service < dns:: Name > + Send + Sync + Default + Clone + ' static ,
312
- HttpsConnector < HttpConnector < R > > : hyper:: client:: connect:: Connect ,
313
- {
314
- /// Construct new client with default configuration to make HTTP requests.
309
+ impl RestClient < GaiResolver > {
310
+ /// Construct new client with default configuration and DNS resolver
311
+ /// implementation to make HTTP requests.
315
312
///
316
- /// Use `Builder` to configure the client.
317
- pub fn new ( url : & str ) -> Result < RestClient < R > , Error > {
318
- RestClient :: < R > :: with_builder ( url, Self :: builder ( ) )
313
+ /// Use `Builder` to configure the client or to use a different
314
+ /// resolver type.
315
+ pub fn new ( url : & str ) -> Result < RestClient < GaiResolver > , Error > {
316
+ RestClient :: with_builder ( url, Self :: builder ( ) )
319
317
}
320
318
321
- /// Construct new blocking client with default configuration to make HTTP requests.
319
+ /// Construct new blocking client with default configuration and DNS resolver
320
+ /// implementation to make HTTP requests.
322
321
///
323
- /// Use `Builder` to configure the client.
322
+ /// Use `Builder` to configure the client or to use a different
323
+ /// resolver type.
324
324
#[ cfg( feature = "blocking" ) ]
325
- pub fn new_blocking ( url : & str ) -> Result < blocking:: RestClient < R > , Error > {
325
+ pub fn new_blocking ( url : & str ) -> Result < blocking:: RestClient < GaiResolver > , Error > {
326
326
RestClient :: new ( url) . and_then ( |client| client. try_into ( ) )
327
327
}
328
+ }
328
329
330
+ impl < R > RestClient < R >
331
+ where
332
+ R : Service < dns:: Name > + Send + Sync + Default + Clone + ' static ,
333
+ HttpsConnector < HttpConnector < R > > : hyper:: client:: connect:: Connect ,
334
+ {
329
335
#[ cfg( feature = "native-tls" ) ]
330
336
fn build_client ( ) -> HyperClient < R >
331
337
{
0 commit comments