Skip to content

Commit 6644a03

Browse files
committed
core::rt: Move the definition of Listener to rt::io
1 parent e5d21b9 commit 6644a03

File tree

2 files changed

+21
-34
lines changed

2 files changed

+21
-34
lines changed

src/libcore/rt/io/mod.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ pub use self::stdio::print;
122122
pub use self::stdio::println;
123123

124124
pub use self::file::FileStream;
125-
pub use self::net::Listener;
126125
pub use self::net::ip::IpAddr;
127126
pub use self::net::tcp::TcpListener;
128127
pub use self::net::tcp::TcpStream;
@@ -137,8 +136,14 @@ pub use self::extensions::WriterByteConversions;
137136
pub mod file;
138137

139138
/// 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+
}
142147

143148
/// Readers and Writers for memory buffers and strings.
144149
#[cfg(not(stage0))] // XXX Using unsnapshotted features
@@ -280,6 +285,19 @@ pub trait Seek {
280285
fn seek(&mut self, pos: i64, style: SeekStyle);
281286
}
282287

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+
283301
/// Common trait for decorator types.
284302
///
285303
/// Provides accessors to get the inner, 'decorated' values. The I/O library

src/libcore/rt/io/net/mod.rs

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)