lib.rs 721 Bytes
Newer Older
Alex Crichton's avatar
Alex Crichton committed
1 2
//! MIO bindings for Unix Domain Sockets

jD91mZM2's avatar
jD91mZM2 committed
3
#![cfg(any(unix, target_os = "redox"))]
Alex Crichton's avatar
Alex Crichton committed
4
#![deny(missing_docs)]
Alex Crichton's avatar
Alex Crichton committed
5
#![doc(html_root_url = "https://docs.rs/mio-uds/0.6")]
Alex Crichton's avatar
Alex Crichton committed
6

7
extern crate iovec;
jD91mZM2's avatar
jD91mZM2 committed
8
#[cfg(not(target_os = "redox"))]
Alex Crichton's avatar
Alex Crichton committed
9 10 11
extern crate libc;
extern crate mio;

jD91mZM2's avatar
jD91mZM2 committed
12
#[cfg(not(target_os = "redox"))]
Alex Crichton's avatar
Alex Crichton committed
13 14
use std::io;

jD91mZM2's avatar
jD91mZM2 committed
15
#[cfg(not(target_os = "redox"))]
Alex Crichton's avatar
Alex Crichton committed
16 17
mod datagram;
mod listener;
jD91mZM2's avatar
jD91mZM2 committed
18
#[cfg(not(target_os = "redox"))]
Alex Crichton's avatar
Alex Crichton committed
19 20 21
mod socket;
mod stream;

jD91mZM2's avatar
jD91mZM2 committed
22
#[cfg(not(target_os = "redox"))]
Alex Crichton's avatar
Alex Crichton committed
23
pub use datagram::UnixDatagram;
jD91mZM2's avatar
jD91mZM2 committed
24 25
pub use listener::UnixListener;
pub use stream::UnixStream;
Alex Crichton's avatar
Alex Crichton committed
26

jD91mZM2's avatar
jD91mZM2 committed
27
#[cfg(not(target_os = "redox"))]
Alex Crichton's avatar
Alex Crichton committed
28 29 30 31 32 33 34
fn cvt(i: libc::c_int) -> io::Result<libc::c_int> {
    if i == -1 {
        Err(io::Error::last_os_error())
    } else {
        Ok(i)
    }
}