@@ -92,8 +92,8 @@ impl TcpStream {
92
92
/// let stream = TcpStream::connect("127.0.0.1:0").await?;
93
93
/// # Ok(())}
94
94
/// ```
95
- pub fn connect < A : ToSocketAddrs > ( addr : A ) -> Connect {
96
- Connect {
95
+ pub fn connect < A : ToSocketAddrs > ( addr : A ) -> ConnectFuture {
96
+ ConnectFuture {
97
97
addrs : Some ( addr. to_socket_addrs ( ) . map ( |iter| iter. collect ( ) ) ) ,
98
98
last_err : None ,
99
99
future : None ,
@@ -218,14 +218,14 @@ impl AsyncWrite for TcpStream {
218
218
/// [`TcpStream::connect`]: struct.TcpStream.html#method.connect
219
219
/// [`TcpStream`]: struct.TcpStream.html
220
220
#[ must_use = "futures do nothing unless you `.await` or poll them" ]
221
- pub struct Connect {
221
+ pub struct ConnectFuture {
222
222
addrs : Option < io:: Result < VecDeque < SocketAddr > > > ,
223
223
last_err : Option < io:: Error > ,
224
224
future : Option < BoxFuture < ' static , io:: Result < Pin < Box < dyn runtime_raw:: TcpStream > > > > > ,
225
225
runtime : & ' static dyn runtime_raw:: Runtime ,
226
226
}
227
227
228
- impl Future for Connect {
228
+ impl Future for ConnectFuture {
229
229
type Output = io:: Result < TcpStream > ;
230
230
231
231
fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
@@ -267,7 +267,7 @@ impl Future for Connect {
267
267
}
268
268
}
269
269
270
- impl fmt:: Debug for Connect {
270
+ impl fmt:: Debug for ConnectFuture {
271
271
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
272
272
f. debug_struct ( "Connect" )
273
273
. field ( "addrs" , & self . addrs )
@@ -413,8 +413,8 @@ impl TcpListener {
413
413
/// }
414
414
/// # Ok(())}
415
415
/// ```
416
- pub fn incoming ( & mut self ) -> Incoming < ' _ > {
417
- Incoming { inner : self }
416
+ pub fn incoming ( & mut self ) -> IncomingStream < ' _ > {
417
+ IncomingStream { inner : self }
418
418
}
419
419
420
420
/// Handle an incoming connection.
@@ -441,9 +441,9 @@ impl TcpListener {
441
441
/// println!("Connected to {}", addr);
442
442
/// # Ok(())}
443
443
/// ```
444
- pub fn accept ( & mut self ) -> Accept < ' _ > {
444
+ pub fn accept ( & mut self ) -> AcceptFuture < ' _ > {
445
445
let incoming = self . incoming ( ) ;
446
- Accept { inner : incoming }
446
+ AcceptFuture { inner : incoming }
447
447
}
448
448
}
449
449
@@ -455,11 +455,11 @@ impl TcpListener {
455
455
/// [`TcpStream`]: struct.TcpStream.html
456
456
#[ must_use = "futures do nothing unless you `.await` or poll them" ]
457
457
#[ derive( Debug ) ]
458
- pub struct Accept < ' stream > {
459
- inner : Incoming < ' stream > ,
458
+ pub struct AcceptFuture < ' stream > {
459
+ inner : IncomingStream < ' stream > ,
460
460
}
461
461
462
- impl < ' stream > Future for Accept < ' stream > {
462
+ impl < ' stream > Future for AcceptFuture < ' stream > {
463
463
type Output = io:: Result < ( TcpStream , SocketAddr ) > ;
464
464
465
465
fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
@@ -479,11 +479,11 @@ impl<'stream> Future for Accept<'stream> {
479
479
/// [`TcpListener`]: struct.TcpStream.html
480
480
#[ must_use = "streams do nothing unless polled" ]
481
481
#[ derive( Debug ) ]
482
- pub struct Incoming < ' listener > {
482
+ pub struct IncomingStream < ' listener > {
483
483
inner : & ' listener mut TcpListener ,
484
484
}
485
485
486
- impl < ' listener > Stream for Incoming < ' listener > {
486
+ impl < ' listener > Stream for IncomingStream < ' listener > {
487
487
type Item = io:: Result < TcpStream > ;
488
488
489
489
fn poll_next ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Option < Self :: Item > > {
0 commit comments