@@ -10,7 +10,7 @@ mod handshake;
1010pub ( crate ) use handshake:: { IoSession , MidHandshake } ;
1111
1212#[ derive( Debug ) ]
13- pub enum TlsState {
13+ pub ( crate ) enum TlsState {
1414 #[ cfg( feature = "early-data" ) ]
1515 EarlyData ( usize , Vec < u8 > ) ,
1616 Stream ,
@@ -21,56 +21,56 @@ pub enum TlsState {
2121
2222impl TlsState {
2323 #[ inline]
24- pub fn shutdown_read ( & mut self ) {
24+ pub ( crate ) fn shutdown_read ( & mut self ) {
2525 match * self {
2626 TlsState :: WriteShutdown | TlsState :: FullyShutdown => * self = TlsState :: FullyShutdown ,
2727 _ => * self = TlsState :: ReadShutdown ,
2828 }
2929 }
3030
3131 #[ inline]
32- pub fn shutdown_write ( & mut self ) {
32+ pub ( crate ) fn shutdown_write ( & mut self ) {
3333 match * self {
3434 TlsState :: ReadShutdown | TlsState :: FullyShutdown => * self = TlsState :: FullyShutdown ,
3535 _ => * self = TlsState :: WriteShutdown ,
3636 }
3737 }
3838
3939 #[ inline]
40- pub fn writeable ( & self ) -> bool {
40+ pub ( crate ) fn writeable ( & self ) -> bool {
4141 !matches ! ( * self , TlsState :: WriteShutdown | TlsState :: FullyShutdown )
4242 }
4343
4444 #[ inline]
45- pub fn readable ( & self ) -> bool {
45+ pub ( crate ) fn readable ( & self ) -> bool {
4646 !matches ! ( * self , TlsState :: ReadShutdown | TlsState :: FullyShutdown )
4747 }
4848
4949 #[ inline]
5050 #[ cfg( feature = "early-data" ) ]
51- pub fn is_early_data ( & self ) -> bool {
51+ pub ( crate ) fn is_early_data ( & self ) -> bool {
5252 matches ! ( self , TlsState :: EarlyData ( ..) )
5353 }
5454
5555 #[ inline]
5656 #[ cfg( not( feature = "early-data" ) ) ]
57- pub const fn is_early_data ( & self ) -> bool {
57+ pub ( crate ) const fn is_early_data ( & self ) -> bool {
5858 false
5959 }
6060}
6161
62- pub struct Stream < ' a , IO , C > {
63- pub io : & ' a mut IO ,
64- pub session : & ' a mut C ,
65- pub eof : bool ,
62+ pub ( crate ) struct Stream < ' a , IO , C > {
63+ pub ( crate ) io : & ' a mut IO ,
64+ pub ( crate ) session : & ' a mut C ,
65+ pub ( crate ) eof : bool ,
6666}
6767
6868impl < ' a , IO : AsyncRead + AsyncWrite + Unpin , C , SD > Stream < ' a , IO , C >
6969where
7070 C : DerefMut + Deref < Target = ConnectionCommon < SD > > ,
7171 SD : SideData ,
7272{
73- pub fn new ( io : & ' a mut IO , session : & ' a mut C ) -> Self {
73+ pub ( crate ) fn new ( io : & ' a mut IO , session : & ' a mut C ) -> Self {
7474 Stream {
7575 io,
7676 session,
@@ -80,16 +80,16 @@ where
8080 }
8181 }
8282
83- pub fn set_eof ( mut self , eof : bool ) -> Self {
83+ pub ( crate ) fn set_eof ( mut self , eof : bool ) -> Self {
8484 self . eof = eof;
8585 self
8686 }
8787
88- pub fn as_mut_pin ( & mut self ) -> Pin < & mut Self > {
88+ pub ( crate ) fn as_mut_pin ( & mut self ) -> Pin < & mut Self > {
8989 Pin :: new ( self )
9090 }
9191
92- pub fn read_io ( & mut self , cx : & mut Context ) -> Poll < io:: Result < usize > > {
92+ pub ( crate ) fn read_io ( & mut self , cx : & mut Context ) -> Poll < io:: Result < usize > > {
9393 let mut reader = SyncReadAdapter { io : self . io , cx } ;
9494
9595 let n = match self . session . read_tls ( & mut reader) {
@@ -110,7 +110,7 @@ where
110110 Poll :: Ready ( Ok ( n) )
111111 }
112112
113- pub fn write_io ( & mut self , cx : & mut Context ) -> Poll < io:: Result < usize > > {
113+ pub ( crate ) fn write_io ( & mut self , cx : & mut Context ) -> Poll < io:: Result < usize > > {
114114 let mut writer = SyncWriteAdapter { io : self . io , cx } ;
115115
116116 match self . session . write_tls ( & mut writer) {
@@ -119,7 +119,7 @@ where
119119 }
120120 }
121121
122- pub fn handshake ( & mut self , cx : & mut Context ) -> Poll < io:: Result < ( usize , usize ) > > {
122+ pub ( crate ) fn handshake ( & mut self , cx : & mut Context ) -> Poll < io:: Result < ( usize , usize ) > > {
123123 let mut wrlen = 0 ;
124124 let mut rdlen = 0 ;
125125
@@ -372,9 +372,9 @@ where
372372/// associated [`Context`].
373373///
374374/// Turns `Poll::Pending` into `WouldBlock`.
375- pub struct SyncReadAdapter < ' a , ' b , T > {
376- pub io : & ' a mut T ,
377- pub cx : & ' a mut Context < ' b > ,
375+ pub ( crate ) struct SyncReadAdapter < ' a , ' b , T > {
376+ pub ( crate ) io : & ' a mut T ,
377+ pub ( crate ) cx : & ' a mut Context < ' b > ,
378378}
379379
380380impl < T : AsyncRead + Unpin > Read for SyncReadAdapter < ' _ , ' _ , T > {
@@ -393,9 +393,9 @@ impl<T: AsyncRead + Unpin> Read for SyncReadAdapter<'_, '_, T> {
393393/// associated [`Context`].
394394///
395395/// Turns `Poll::Pending` into `WouldBlock`.
396- pub struct SyncWriteAdapter < ' a , ' b , T > {
397- pub io : & ' a mut T ,
398- pub cx : & ' a mut Context < ' b > ,
396+ pub ( crate ) struct SyncWriteAdapter < ' a , ' b , T > {
397+ pub ( crate ) io : & ' a mut T ,
398+ pub ( crate ) cx : & ' a mut Context < ' b > ,
399399}
400400
401401impl < T : Unpin > SyncWriteAdapter < ' _ , ' _ , T > {
0 commit comments