@@ -122,7 +122,6 @@ pub use self::stdio::print;
122
122
pub use self :: stdio:: println;
123
123
124
124
pub use self :: file:: FileStream ;
125
- pub use self :: net:: Listener ;
126
125
pub use self :: net:: ip:: IpAddr ;
127
126
pub use self :: net:: tcp:: TcpListener ;
128
127
pub use self :: net:: tcp:: TcpStream ;
@@ -137,8 +136,14 @@ pub use self::extensions::WriterByteConversions;
137
136
pub mod file;
138
137
139
138
/// Synchronous, non-blocking network I/O.
140
- #[ path = "net/mod.rs" ]
141
- pub mod net;
139
+ pub mod net {
140
+ pub mod tcp;
141
+ pub mod udp;
142
+ pub mod ip;
143
+ #[ cfg( unix) ]
144
+ pub mod unix;
145
+ pub mod http;
146
+ }
142
147
143
148
/// Readers and Writers for memory buffers and strings.
144
149
#[ cfg( not( stage0) ) ] // XXX Using unsnapshotted features
@@ -280,6 +285,19 @@ pub trait Seek {
280
285
fn seek ( & mut self , pos : i64 , style : SeekStyle ) ;
281
286
}
282
287
288
+ /// A listener is a value that listens for connections
289
+ pub trait Listener < S > {
290
+ /// Wait for and accept an incoming connection
291
+ ///
292
+ /// Returns `None` on timeout.
293
+ ///
294
+ /// # Failure
295
+ ///
296
+ /// Raises `io_error` condition. If the condition is handled,
297
+ /// then `accept` returns `None`.
298
+ fn accept ( & mut self ) -> Option < S > ;
299
+ }
300
+
283
301
/// Common trait for decorator types.
284
302
///
285
303
/// Provides accessors to get the inner, 'decorated' values. The I/O library
0 commit comments