@@ -64,7 +64,7 @@ macro_rules! ready {
6464}
6565
6666pub mod client;
67- pub use client:: { TlsConnector , TlsConnectorWithAlpn } ;
67+ pub use client:: { Connect , FallibleConnect , TlsConnector , TlsConnectorWithAlpn } ;
6868mod common;
6969use common:: { MidHandshake , TlsState } ;
7070pub mod server;
@@ -295,45 +295,13 @@ where
295295 }
296296}
297297
298- /// Future returned from `TlsConnector::connect` which will resolve
299- /// once the connection handshake has finished.
300- pub struct Connect < IO > ( MidHandshake < client:: TlsStream < IO > > ) ;
301-
302298/// Future returned from `TlsAcceptor::accept` which will resolve
303299/// once the accept handshake has finished.
304300pub struct Accept < IO > ( MidHandshake < server:: TlsStream < IO > > ) ;
305301
306- /// Like [Connect], but returns `IO` on failure.
307- pub struct FallibleConnect < IO > ( MidHandshake < client:: TlsStream < IO > > ) ;
308-
309302/// Like [Accept], but returns `IO` on failure.
310303pub struct FallibleAccept < IO > ( MidHandshake < server:: TlsStream < IO > > ) ;
311304
312- impl < IO > Connect < IO > {
313- #[ inline]
314- pub fn into_fallible ( self ) -> FallibleConnect < IO > {
315- FallibleConnect ( self . 0 )
316- }
317-
318- pub fn get_ref ( & self ) -> Option < & IO > {
319- match & self . 0 {
320- MidHandshake :: Handshaking ( sess) => Some ( sess. get_ref ( ) . 0 ) ,
321- MidHandshake :: SendAlert { io, .. } => Some ( io) ,
322- MidHandshake :: Error { io, .. } => Some ( io) ,
323- MidHandshake :: End => None ,
324- }
325- }
326-
327- pub fn get_mut ( & mut self ) -> Option < & mut IO > {
328- match & mut self . 0 {
329- MidHandshake :: Handshaking ( sess) => Some ( sess. get_mut ( ) . 0 ) ,
330- MidHandshake :: SendAlert { io, .. } => Some ( io) ,
331- MidHandshake :: Error { io, .. } => Some ( io) ,
332- MidHandshake :: End => None ,
333- }
334- }
335- }
336-
337305impl < IO > Accept < IO > {
338306 #[ inline]
339307 pub fn into_fallible ( self ) -> FallibleAccept < IO > {
@@ -359,15 +327,6 @@ impl<IO> Accept<IO> {
359327 }
360328}
361329
362- impl < IO : AsyncRead + AsyncWrite + Unpin > Future for Connect < IO > {
363- type Output = io:: Result < client:: TlsStream < IO > > ;
364-
365- #[ inline]
366- fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
367- Pin :: new ( & mut self . 0 ) . poll ( cx) . map_err ( |( err, _) | err)
368- }
369- }
370-
371330impl < IO : AsyncRead + AsyncWrite + Unpin > Future for Accept < IO > {
372331 type Output = io:: Result < server:: TlsStream < IO > > ;
373332
@@ -377,15 +336,6 @@ impl<IO: AsyncRead + AsyncWrite + Unpin> Future for Accept<IO> {
377336 }
378337}
379338
380- impl < IO : AsyncRead + AsyncWrite + Unpin > Future for FallibleConnect < IO > {
381- type Output = Result < client:: TlsStream < IO > , ( io:: Error , IO ) > ;
382-
383- #[ inline]
384- fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
385- Pin :: new ( & mut self . 0 ) . poll ( cx)
386- }
387- }
388-
389339impl < IO : AsyncRead + AsyncWrite + Unpin > Future for FallibleAccept < IO > {
390340 type Output = Result < server:: TlsStream < IO > , ( io:: Error , IO ) > ;
391341
0 commit comments