@@ -24,7 +24,7 @@ use crate::common::{exec::Exec, ready};
24
24
25
25
// FIXME: allow() required due to `impl Trait` leaking types to this lint
26
26
#[ allow( missing_debug_implementations) ]
27
- pub ( super ) struct Pool < T , K : Key > {
27
+ pub struct Pool < T , K : Key > {
28
28
// If the pool is disabled, this is None.
29
29
inner : Option < Arc < Mutex < PoolInner < T , K > > > > ,
30
30
}
@@ -34,7 +34,7 @@ pub(super) struct Pool<T, K: Key> {
34
34
// This is a trait to allow the `client::pool::tests` to work for `i32`.
35
35
//
36
36
// See https://github.com/hyperium/hyper/issues/1429
37
- pub ( super ) trait Poolable : Unpin + Send + Sized + ' static {
37
+ pub trait Poolable : Unpin + Send + Sized + ' static {
38
38
fn is_open ( & self ) -> bool ;
39
39
/// Reserve this connection.
40
40
///
@@ -54,7 +54,7 @@ impl<T> Key for T where T: Eq + Hash + Clone + Debug + Unpin + Send + 'static {}
54
54
/// used for multiple requests.
55
55
// FIXME: allow() required due to `impl Trait` leaking types to this lint
56
56
#[ allow( missing_debug_implementations) ]
57
- pub ( super ) enum Reservation < T > {
57
+ pub enum Reservation < T > {
58
58
/// This connection could be used multiple times, the first one will be
59
59
/// reinserted into the `idle` pool, and the second will be given to
60
60
/// the `Checkout`.
@@ -66,7 +66,7 @@ pub(super) enum Reservation<T> {
66
66
}
67
67
68
68
/// Simple type alias in case the key type needs to be adjusted.
69
- // pub(super) type Key = (http::uri::Scheme, http::uri::Authority); //Arc<String>;
69
+ // pub type Key = (http::uri::Scheme, http::uri::Authority); //Arc<String>;
70
70
71
71
struct PoolInner < T , K : Eq + Hash > {
72
72
// A flag that a connection is being established, and the connection
@@ -101,19 +101,19 @@ struct PoolInner<T, K: Eq + Hash> {
101
101
struct WeakOpt < T > ( Option < Weak < T > > ) ;
102
102
103
103
#[ derive( Clone , Copy , Debug ) ]
104
- pub ( super ) struct Config {
105
- pub ( super ) idle_timeout : Option < Duration > ,
106
- pub ( super ) max_idle_per_host : usize ,
104
+ pub struct Config {
105
+ pub idle_timeout : Option < Duration > ,
106
+ pub max_idle_per_host : usize ,
107
107
}
108
108
109
109
impl Config {
110
- pub ( super ) fn is_enabled ( & self ) -> bool {
110
+ pub fn is_enabled ( & self ) -> bool {
111
111
self . max_idle_per_host > 0
112
112
}
113
113
}
114
114
115
115
impl < T , K : Key > Pool < T , K > {
116
- pub ( super ) fn new ( config : Config , __exec : & Exec ) -> Pool < T , K > {
116
+ pub fn new ( config : Config , __exec : & Exec ) -> Pool < T , K > {
117
117
let inner = if config. is_enabled ( ) {
118
118
Some ( Arc :: new ( Mutex :: new ( PoolInner {
119
119
connecting : HashSet :: new ( ) ,
@@ -153,7 +153,7 @@ impl<T, K: Key> Pool<T, K> {
153
153
impl < T : Poolable , K : Key > Pool < T , K > {
154
154
/// Returns a `Checkout` which is a future that resolves if an idle
155
155
/// connection becomes available.
156
- pub ( super ) fn checkout ( & self , key : K ) -> Checkout < T , K > {
156
+ pub fn checkout ( & self , key : K ) -> Checkout < T , K > {
157
157
Checkout {
158
158
key,
159
159
pool : self . clone ( ) ,
@@ -163,7 +163,7 @@ impl<T: Poolable, K: Key> Pool<T, K> {
163
163
164
164
/// Ensure that there is only ever 1 connecting task for HTTP/2
165
165
/// connections. This does nothing for HTTP/1.
166
- pub ( super ) fn connecting ( & self , key : & K , ver : Ver ) -> Option < Connecting < T , K > > {
166
+ pub fn connecting ( & self , key : & K , ver : Ver ) -> Option < Connecting < T , K > > {
167
167
if ver == Ver :: Http2 {
168
168
if let Some ( ref enabled) = self . inner {
169
169
let mut inner = enabled. lock ( ) . unwrap ( ) ;
@@ -213,7 +213,7 @@ impl<T: Poolable, K: Key> Pool<T, K> {
213
213
}
214
214
*/
215
215
216
- pub ( super ) fn pooled (
216
+ pub fn pooled (
217
217
& self ,
218
218
#[ cfg_attr( not( feature = "http2" ) , allow( unused_mut) ) ] mut connecting : Connecting < T , K > ,
219
219
value : T ,
@@ -496,19 +496,19 @@ impl<T, K: Key> Clone for Pool<T, K> {
496
496
497
497
/// A wrapped poolable value that tries to reinsert to the Pool on Drop.
498
498
// Note: The bounds `T: Poolable` is needed for the Drop impl.
499
- pub ( super ) struct Pooled < T : Poolable , K : Key > {
499
+ pub struct Pooled < T : Poolable , K : Key > {
500
500
value : Option < T > ,
501
501
is_reused : bool ,
502
502
key : K ,
503
503
pool : WeakOpt < Mutex < PoolInner < T , K > > > ,
504
504
}
505
505
506
506
impl < T : Poolable , K : Key > Pooled < T , K > {
507
- pub ( super ) fn is_reused ( & self ) -> bool {
507
+ pub fn is_reused ( & self ) -> bool {
508
508
self . is_reused
509
509
}
510
510
511
- pub ( super ) fn is_pool_enabled ( & self ) -> bool {
511
+ pub fn is_pool_enabled ( & self ) -> bool {
512
512
self . pool . 0 . is_some ( )
513
513
}
514
514
@@ -569,14 +569,14 @@ struct Idle<T> {
569
569
570
570
// FIXME: allow() required due to `impl Trait` leaking types to this lint
571
571
#[ allow( missing_debug_implementations) ]
572
- pub ( super ) struct Checkout < T , K : Key > {
572
+ pub struct Checkout < T , K : Key > {
573
573
key : K ,
574
574
pool : Pool < T , K > ,
575
575
waiter : Option < oneshot:: Receiver < T > > ,
576
576
}
577
577
578
578
#[ derive( Debug ) ]
579
- pub ( super ) struct CheckoutIsClosedError ;
579
+ pub struct CheckoutIsClosedError ;
580
580
581
581
impl Error for CheckoutIsClosedError { }
582
582
@@ -696,13 +696,13 @@ impl<T, K: Key> Drop for Checkout<T, K> {
696
696
697
697
// FIXME: allow() required due to `impl Trait` leaking types to this lint
698
698
#[ allow( missing_debug_implementations) ]
699
- pub ( super ) struct Connecting < T : Poolable , K : Key > {
699
+ pub struct Connecting < T : Poolable , K : Key > {
700
700
key : K ,
701
701
pool : WeakOpt < Mutex < PoolInner < T , K > > > ,
702
702
}
703
703
704
704
impl < T : Poolable , K : Key > Connecting < T , K > {
705
- pub ( super ) fn alpn_h2 ( self , pool : & Pool < T , K > ) -> Option < Self > {
705
+ pub fn alpn_h2 ( self , pool : & Pool < T , K > ) -> Option < Self > {
706
706
debug_assert ! (
707
707
self . pool. 0 . is_none( ) ,
708
708
"Connecting::alpn_h2 but already Http2"
0 commit comments