File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ use http::StatusCode;
20
20
#[ cfg( feature = "reqwest" ) ]
21
21
use reqwest:: { Client as HttpClient , Response as HttpResponse } ;
22
22
#[ cfg( feature = "surf" ) ]
23
- use surf:: { Client as HttpClient , Response as HttpResponse } ;
23
+ use surf:: { Client as HttpClient , HttpClient as SurfHttpClient , Response as HttpResponse } ;
24
24
25
25
use crate :: query:: QueryType ;
26
26
use crate :: Error ;
@@ -91,6 +91,13 @@ impl Client {
91
91
self
92
92
}
93
93
94
+ /// Allows creation of custom http clients
95
+ #[ cfg( feature = "surf" ) ]
96
+ pub fn with_http_client < T : SurfHttpClient > ( mut self , http_client : T ) -> Self {
97
+ self . client = HttpClient :: with_http_client ( http_client) ;
98
+ self
99
+ }
100
+
94
101
/// Returns the name of the database the client is using
95
102
pub fn database_name ( & self ) -> & str {
96
103
// safe to unwrap: we always set the database name in `Self::new`
You can’t perform that action at this time.
0 commit comments