diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-15 19:44:08 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-24 14:21:56 -0700 |
| commit | bac96818580a97c049532e50702c2a8204e11754 (patch) | |
| tree | cb8fc611cf345d6f6c539bd62fd778b7b214d1a6 /src/libstd/rt/rtio.rs | |
| parent | 61f8c059c4c6082683d78b2ee3d963f65fa1eb98 (diff) | |
| download | rust-bac96818580a97c049532e50702c2a8204e11754.tar.gz rust-bac96818580a97c049532e50702c2a8204e11754.zip | |
Implement io::net::unix
Diffstat (limited to 'src/libstd/rt/rtio.rs')
| -rw-r--r-- | src/libstd/rt/rtio.rs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/libstd/rt/rtio.rs b/src/libstd/rt/rtio.rs index 501def8b060..0964f94d6d5 100644 --- a/src/libstd/rt/rtio.rs +++ b/src/libstd/rt/rtio.rs @@ -36,6 +36,8 @@ pub type PausibleIdleCallback = uvio::UvPausibleIdleCallback; pub type RtioPipeObject = uvio::UvPipeStream; pub type RtioUnboundPipeObject = uvio::UvUnboundPipe; pub type RtioProcessObject = uvio::UvProcess; +pub type RtioUnixListenerObject = uvio::UvUnixListener; +pub type RtioUnixAcceptorObject = uvio::UvUnixAcceptor; pub trait EventLoop { fn run(&mut self); @@ -86,7 +88,12 @@ pub trait IoFactory { Result<~[Path], IoError>; fn pipe_init(&mut self, ipc: bool) -> Result<~RtioUnboundPipeObject, IoError>; fn spawn(&mut self, config: ProcessConfig) - -> Result<(~RtioProcessObject, ~[Option<RtioPipeObject>]), IoError>; + -> Result<(~RtioProcessObject, ~[Option<~RtioPipeObject>]), IoError>; + + fn unix_bind<P: PathLike>(&mut self, path: &P) -> + Result<~RtioUnixListenerObject, IoError>; + fn unix_connect<P: PathLike>(&mut self, path: &P) -> + Result<~RtioPipeObject, IoError>; } pub trait RtioTcpListener : RtioSocket { @@ -154,3 +161,13 @@ pub trait RtioPipe { fn read(&mut self, buf: &mut [u8]) -> Result<uint, IoError>; fn write(&mut self, buf: &[u8]) -> Result<(), IoError>; } + +pub trait RtioUnixListener { + fn listen(self) -> Result<~RtioUnixAcceptorObject, IoError>; +} + +pub trait RtioUnixAcceptor { + fn accept(&mut self) -> Result<~RtioPipeObject, IoError>; + fn accept_simultaneously(&mut self) -> Result<(), IoError>; + fn dont_accept_simultaneously(&mut self) -> Result<(), IoError>; +} |
