@@ -23,7 +23,7 @@ use crate::common::{exec::Exec, ready};
23
23
24
24
// FIXME: allow() required due to `impl Trait` leaking types to this lint
25
25
#[ allow( missing_debug_implementations) ]
26
- pub ( super ) struct Pool < T > {
26
+ pub struct Pool < T > {
27
27
// If the pool is disabled, this is None.
28
28
inner : Option < Arc < Mutex < PoolInner < T > > > > ,
29
29
}
@@ -33,7 +33,7 @@ pub(super) struct Pool<T> {
33
33
// This is a trait to allow the `client::pool::tests` to work for `i32`.
34
34
//
35
35
// See https://github.com/hyperium/hyper/issues/1429
36
- pub ( super ) trait Poolable : Unpin + Send + Sized + ' static {
36
+ pub trait Poolable : Unpin + Send + Sized + ' static {
37
37
fn is_open ( & self ) -> bool ;
38
38
/// Reserve this connection.
39
39
///
@@ -49,7 +49,7 @@ pub(super) trait Poolable: Unpin + Send + Sized + 'static {
49
49
/// used for multiple requests.
50
50
// FIXME: allow() required due to `impl Trait` leaking types to this lint
51
51
#[ allow( missing_debug_implementations) ]
52
- pub ( super ) enum Reservation < T > {
52
+ pub enum Reservation < T > {
53
53
/// This connection could be used multiple times, the first one will be
54
54
/// reinserted into the `idle` pool, and the second will be given to
55
55
/// the `Checkout`.
@@ -61,7 +61,7 @@ pub(super) enum Reservation<T> {
61
61
}
62
62
63
63
/// Simple type alias in case the key type needs to be adjusted.
64
- pub ( super ) type Key = ( http:: uri:: Scheme , http:: uri:: Authority ) ; //Arc<String>;
64
+ pub type Key = ( http:: uri:: Scheme , http:: uri:: Authority ) ; //Arc<String>;
65
65
66
66
struct PoolInner < T > {
67
67
// A flag that a connection is being established, and the connection
@@ -96,19 +96,19 @@ struct PoolInner<T> {
96
96
struct WeakOpt < T > ( Option < Weak < T > > ) ;
97
97
98
98
#[ derive( Clone , Copy , Debug ) ]
99
- pub ( super ) struct Config {
100
- pub ( super ) idle_timeout : Option < Duration > ,
101
- pub ( super ) max_idle_per_host : usize ,
99
+ pub struct Config {
100
+ pub idle_timeout : Option < Duration > ,
101
+ pub max_idle_per_host : usize ,
102
102
}
103
103
104
104
impl Config {
105
- pub ( super ) fn is_enabled ( & self ) -> bool {
105
+ pub fn is_enabled ( & self ) -> bool {
106
106
self . max_idle_per_host > 0
107
107
}
108
108
}
109
109
110
110
impl < T > Pool < T > {
111
- pub ( super ) fn new ( config : Config , __exec : & Exec ) -> Pool < T > {
111
+ pub fn new ( config : Config , __exec : & Exec ) -> Pool < T > {
112
112
let inner = if config. is_enabled ( ) {
113
113
Some ( Arc :: new ( Mutex :: new ( PoolInner {
114
114
connecting : HashSet :: new ( ) ,
@@ -148,7 +148,7 @@ impl<T> Pool<T> {
148
148
impl < T : Poolable > Pool < T > {
149
149
/// Returns a `Checkout` which is a future that resolves if an idle
150
150
/// connection becomes available.
151
- pub ( super ) fn checkout ( & self , key : Key ) -> Checkout < T > {
151
+ pub fn checkout ( & self , key : Key ) -> Checkout < T > {
152
152
Checkout {
153
153
key,
154
154
pool : self . clone ( ) ,
@@ -158,7 +158,7 @@ impl<T: Poolable> Pool<T> {
158
158
159
159
/// Ensure that there is only ever 1 connecting task for HTTP/2
160
160
/// connections. This does nothing for HTTP/1.
161
- pub ( super ) fn connecting ( & self , key : & Key , ver : Ver ) -> Option < Connecting < T > > {
161
+ pub fn connecting ( & self , key : & Key , ver : Ver ) -> Option < Connecting < T > > {
162
162
if ver == Ver :: Http2 {
163
163
if let Some ( ref enabled) = self . inner {
164
164
let mut inner = enabled. lock ( ) . unwrap ( ) ;
@@ -208,7 +208,7 @@ impl<T: Poolable> Pool<T> {
208
208
}
209
209
*/
210
210
211
- pub ( super ) fn pooled (
211
+ pub fn pooled (
212
212
& self ,
213
213
#[ cfg_attr( not( feature = "http2" ) , allow( unused_mut) ) ] mut connecting : Connecting < T > ,
214
214
value : T ,
@@ -491,19 +491,19 @@ impl<T> Clone for Pool<T> {
491
491
492
492
/// A wrapped poolable value that tries to reinsert to the Pool on Drop.
493
493
// Note: The bounds `T: Poolable` is needed for the Drop impl.
494
- pub ( super ) struct Pooled < T : Poolable > {
494
+ pub struct Pooled < T : Poolable > {
495
495
value : Option < T > ,
496
496
is_reused : bool ,
497
497
key : Key ,
498
498
pool : WeakOpt < Mutex < PoolInner < T > > > ,
499
499
}
500
500
501
501
impl < T : Poolable > Pooled < T > {
502
- pub ( super ) fn is_reused ( & self ) -> bool {
502
+ pub fn is_reused ( & self ) -> bool {
503
503
self . is_reused
504
504
}
505
505
506
- pub ( super ) fn is_pool_enabled ( & self ) -> bool {
506
+ pub fn is_pool_enabled ( & self ) -> bool {
507
507
self . pool . 0 . is_some ( )
508
508
}
509
509
@@ -564,14 +564,14 @@ struct Idle<T> {
564
564
565
565
// FIXME: allow() required due to `impl Trait` leaking types to this lint
566
566
#[ allow( missing_debug_implementations) ]
567
- pub ( super ) struct Checkout < T > {
567
+ pub struct Checkout < T > {
568
568
key : Key ,
569
569
pool : Pool < T > ,
570
570
waiter : Option < oneshot:: Receiver < T > > ,
571
571
}
572
572
573
573
#[ derive( Debug ) ]
574
- pub ( super ) struct CheckoutIsClosedError ;
574
+ pub struct CheckoutIsClosedError ;
575
575
576
576
impl Error for CheckoutIsClosedError { }
577
577
@@ -691,13 +691,13 @@ impl<T> Drop for Checkout<T> {
691
691
692
692
// FIXME: allow() required due to `impl Trait` leaking types to this lint
693
693
#[ allow( missing_debug_implementations) ]
694
- pub ( super ) struct Connecting < T : Poolable > {
694
+ pub struct Connecting < T : Poolable > {
695
695
key : Key ,
696
696
pool : WeakOpt < Mutex < PoolInner < T > > > ,
697
697
}
698
698
699
699
impl < T : Poolable > Connecting < T > {
700
- pub ( super ) fn alpn_h2 ( self , pool : & Pool < T > ) -> Option < Self > {
700
+ pub fn alpn_h2 ( self , pool : & Pool < T > ) -> Option < Self > {
701
701
debug_assert ! (
702
702
self . pool. 0 . is_none( ) ,
703
703
"Connecting::alpn_h2 but already Http2"
0 commit comments