@@ -9,13 +9,11 @@ use crate::bucket_ops::{BucketConfiguration, CreateBucketResponse};
9
9
use crate :: command:: { Command , Multipart } ;
10
10
use crate :: creds:: Credentials ;
11
11
use crate :: region:: Region ;
12
- #[ cfg( any( feature = "with-tokio" , feature = "use- tokio-native-tls" ) ) ]
12
+ #[ cfg( any( feature = "with-tokio" , feature = "tokio-native-tls" ) ) ]
13
13
use crate :: request:: tokio_backend:: client;
14
- #[ cfg( any( feature = "use-tokio-native-tls" , feature = "tokio-rustls-tls" ) ) ]
15
- use crate :: request:: tokio_backend:: HttpsConnector ;
16
- use crate :: request:: ResponseData ;
17
14
#[ cfg( any( feature = "with-tokio" , feature = "with-async-std" ) ) ]
18
15
use crate :: request:: ResponseDataStream ;
16
+ use crate :: request:: { Request as _, ResponseData } ;
19
17
use std:: str:: FromStr ;
20
18
use std:: sync:: Arc ;
21
19
@@ -33,7 +31,7 @@ pub type Query = HashMap<String, String>;
33
31
#[ cfg( feature = "with-async-std" ) ]
34
32
use crate :: request:: async_std_backend:: SurfRequest as RequestImpl ;
35
33
#[ cfg( feature = "with-tokio" ) ]
36
- use crate :: request:: tokio_backend:: HyperRequest as RequestImpl ;
34
+ use crate :: request:: tokio_backend:: ReqwestRequest as RequestImpl ;
37
35
38
36
#[ cfg( feature = "with-async-std" ) ]
39
37
use async_std:: io:: Write as AsyncWrite ;
@@ -52,7 +50,6 @@ use async_std::io::Read as AsyncRead;
52
50
53
51
use crate :: error:: S3Error ;
54
52
use crate :: post_policy:: PresignedPost ;
55
- use crate :: request:: Request ;
56
53
use crate :: serde_types:: {
57
54
BucketLifecycleConfiguration , BucketLocationResult , CompleteMultipartUploadData ,
58
55
CorsConfiguration , HeadObjectResult , InitiateMultipartUploadResponse , ListBucketResult ,
@@ -108,14 +105,14 @@ pub struct Bucket {
108
105
pub request_timeout : Option < Duration > ,
109
106
path_style : bool ,
110
107
listobjects_v2 : bool ,
111
- #[ cfg( any( feature = "use- tokio-native-tls" , feature = "tokio-rustls-tls" ) ) ]
112
- http_client : Arc < hyper :: Client < HttpsConnector < hyper :: client :: HttpConnector > > > ,
108
+ #[ cfg( any( feature = "tokio-native-tls" , feature = "tokio-rustls-tls" ) ) ]
109
+ http_client : Arc < reqwest :: Client > ,
113
110
#[ cfg( all(
114
111
feature = "with-tokio" ,
115
- not( feature = "use- tokio-native-tls" ) ,
112
+ not( feature = "tokio-native-tls" ) ,
116
113
not( feature = "tokio-rustls-tls" )
117
114
) ) ]
118
- http_client : Arc < hyper :: Client < hyper :: client :: HttpConnector > > ,
115
+ http_client : Arc < reqwest :: Client > ,
119
116
}
120
117
121
118
impl Bucket {
@@ -134,17 +131,8 @@ impl Bucket {
134
131
}
135
132
}
136
133
137
- #[ cfg( all(
138
- feature = "with-tokio" ,
139
- not( feature = "use-tokio-native-tls" ) ,
140
- not( feature = "tokio-rustls-tls" )
141
- ) ) ]
142
- pub fn http_client ( & self ) -> Arc < hyper:: Client < hyper:: client:: HttpConnector > > {
143
- Arc :: clone ( & self . http_client )
144
- }
145
-
146
- #[ cfg( any( feature = "use-tokio-native-tls" , feature = "tokio-rustls-tls" ) ) ]
147
- pub fn http_client ( & self ) -> Arc < hyper:: Client < HttpsConnector < hyper:: client:: HttpConnector > > > {
134
+ #[ cfg( feature = "with-tokio" ) ]
135
+ pub fn http_client ( & self ) -> Arc < reqwest:: Client > {
148
136
Arc :: clone ( & self . http_client )
149
137
}
150
138
}
@@ -588,7 +576,7 @@ impl Bucket {
588
576
request_timeout : DEFAULT_REQUEST_TIMEOUT ,
589
577
path_style : false ,
590
578
listobjects_v2 : true ,
591
- #[ cfg( any( feature = "use- tokio-native-tls" , feature = "with-tokio" ) ) ]
579
+ #[ cfg( any( feature = "tokio-native-tls" , feature = "with-tokio" ) ) ]
592
580
http_client : Arc :: new ( client ( DEFAULT_REQUEST_TIMEOUT ) ?) ,
593
581
} ) )
594
582
}
@@ -614,7 +602,7 @@ impl Bucket {
614
602
request_timeout : DEFAULT_REQUEST_TIMEOUT ,
615
603
path_style : false ,
616
604
listobjects_v2 : true ,
617
- #[ cfg( any( feature = "use- tokio-native-tls" , feature = "with-tokio" ) ) ]
605
+ #[ cfg( any( feature = "tokio-native-tls" , feature = "with-tokio" ) ) ]
618
606
http_client : Arc :: new ( client ( DEFAULT_REQUEST_TIMEOUT ) ?) ,
619
607
} )
620
608
}
@@ -629,7 +617,7 @@ impl Bucket {
629
617
request_timeout : self . request_timeout ,
630
618
path_style : true ,
631
619
listobjects_v2 : self . listobjects_v2 ,
632
- #[ cfg( any( feature = "use- tokio-native-tls" , feature = "with-tokio" ) ) ]
620
+ #[ cfg( any( feature = "tokio-native-tls" , feature = "with-tokio" ) ) ]
633
621
http_client : self . http_client . clone ( ) ,
634
622
} )
635
623
}
@@ -644,7 +632,7 @@ impl Bucket {
644
632
request_timeout : self . request_timeout ,
645
633
path_style : self . path_style ,
646
634
listobjects_v2 : self . listobjects_v2 ,
647
- #[ cfg( any( feature = "use- tokio-native-tls" , feature = "with-tokio" ) ) ]
635
+ #[ cfg( any( feature = "tokio-native-tls" , feature = "with-tokio" ) ) ]
648
636
http_client : self . http_client . clone ( ) ,
649
637
} )
650
638
}
@@ -662,7 +650,7 @@ impl Bucket {
662
650
request_timeout : self . request_timeout ,
663
651
path_style : self . path_style ,
664
652
listobjects_v2 : self . listobjects_v2 ,
665
- #[ cfg( any( feature = "use- tokio-native-tls" , feature = "with-tokio" ) ) ]
653
+ #[ cfg( any( feature = "tokio-native-tls" , feature = "with-tokio" ) ) ]
666
654
http_client : self . http_client . clone ( ) ,
667
655
} )
668
656
}
@@ -677,7 +665,7 @@ impl Bucket {
677
665
request_timeout : Some ( request_timeout) ,
678
666
path_style : self . path_style ,
679
667
listobjects_v2 : self . listobjects_v2 ,
680
- #[ cfg( any( feature = "use- tokio-native-tls" , feature = "with-tokio" ) ) ]
668
+ #[ cfg( any( feature = "tokio-native-tls" , feature = "with-tokio" ) ) ]
681
669
http_client : Arc :: new ( client ( Some ( request_timeout) ) ?) ,
682
670
} ) )
683
671
}
@@ -692,7 +680,7 @@ impl Bucket {
692
680
request_timeout : self . request_timeout ,
693
681
path_style : self . path_style ,
694
682
listobjects_v2 : false ,
695
- #[ cfg( any( feature = "use- tokio-native-tls" , feature = "with-tokio" ) ) ]
683
+ #[ cfg( any( feature = "tokio-native-tls" , feature = "with-tokio" ) ) ]
696
684
http_client : self . http_client . clone ( ) ,
697
685
}
698
686
}
0 commit comments