[src]

Trait std::rt::rtio::IoFactory

pub trait IoFactory {
    fn tcp_connect(&mut self, addr: SocketAddr) -> IoResult<~RtioTcpStream<Send>>;
    fn tcp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioTcpListener<Send>>;
    fn udp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioUdpSocket<Send>>;
    fn unix_bind(&mut self, path: &CString) -> IoResult<~RtioUnixListener<Send>>;
    fn unix_connect(&mut self, path: &CString) -> IoResult<~RtioPipe<Send>>;
    fn get_host_addresses(&mut self, host: Option<&str>, servname: Option<&str>, hint: Option<Hint>) -> IoResult<~[Info]>;
    fn fs_from_raw_fd(&mut self, fd: c_int, close: CloseBehavior) -> ~RtioFileStream<Send>;
    fn fs_open(&mut self, path: &CString, fm: FileMode, fa: FileAccess) -> IoResult<~RtioFileStream<Send>>;
    fn fs_unlink(&mut self, path: &CString) -> IoResult<()>;
    fn fs_stat(&mut self, path: &CString) -> IoResult<FileStat>;
    fn fs_mkdir(&mut self, path: &CString, mode: FilePermission) -> IoResult<()>;
    fn fs_chmod(&mut self, path: &CString, mode: FilePermission) -> IoResult<()>;
    fn fs_rmdir(&mut self, path: &CString) -> IoResult<()>;
    fn fs_rename(&mut self, path: &CString, to: &CString) -> IoResult<()>;
    fn fs_readdir(&mut self, path: &CString, flags: c_int) -> IoResult<~[Path]>;
    fn fs_lstat(&mut self, path: &CString) -> IoResult<FileStat>;
    fn fs_chown(&mut self, path: &CString, uid: int, gid: int) -> IoResult<()>;
    fn fs_readlink(&mut self, path: &CString) -> IoResult<Path>;
    fn fs_symlink(&mut self, src: &CString, dst: &CString) -> IoResult<()>;
    fn fs_link(&mut self, src: &CString, dst: &CString) -> IoResult<()>;
    fn fs_utime(&mut self, src: &CString, atime: u64, mtime: u64) -> IoResult<()>;
    fn timer_init(&mut self) -> IoResult<~RtioTimer<Send>>;
    fn spawn(&mut self, config: ProcessConfig) -> IoResult<(~RtioProcess<Send>, ~[Option<~RtioPipe<Send>>])>;
    fn kill(&mut self, pid: pid_t, signal: int) -> IoResult<()>;
    fn pipe_open(&mut self, fd: c_int) -> IoResult<~RtioPipe<Send>>;
    fn tty_open(&mut self, fd: c_int, readable: bool) -> IoResult<~RtioTTY<Send>>;
    fn signal(&mut self, signal: Signum, channel: Sender<Signum>) -> IoResult<~RtioSignal<Send>>;
}

Required Methods

fn tcp_connect(&mut self, addr: SocketAddr) -> IoResult<~RtioTcpStream<Send>>

fn tcp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioTcpListener<Send>>

fn udp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioUdpSocket<Send>>

fn unix_bind(&mut self, path: &CString) -> IoResult<~RtioUnixListener<Send>>

fn unix_connect(&mut self, path: &CString) -> IoResult<~RtioPipe<Send>>

fn get_host_addresses(&mut self, host: Option<&str>, servname: Option<&str>, hint: Option<Hint>) -> IoResult<~[Info]>

fn fs_from_raw_fd(&mut self, fd: c_int, close: CloseBehavior) -> ~RtioFileStream<Send>

fn fs_open(&mut self, path: &CString, fm: FileMode, fa: FileAccess) -> IoResult<~RtioFileStream<Send>>

fn fs_stat(&mut self, path: &CString) -> IoResult<FileStat>

fn fs_mkdir(&mut self, path: &CString, mode: FilePermission) -> IoResult<()>

fn fs_chmod(&mut self, path: &CString, mode: FilePermission) -> IoResult<()>

fn fs_rmdir(&mut self, path: &CString) -> IoResult<()>

fn fs_rename(&mut self, path: &CString, to: &CString) -> IoResult<()>

fn fs_readdir(&mut self, path: &CString, flags: c_int) -> IoResult<~[Path]>

fn fs_lstat(&mut self, path: &CString) -> IoResult<FileStat>

fn fs_chown(&mut self, path: &CString, uid: int, gid: int) -> IoResult<()>

fn fs_utime(&mut self, src: &CString, atime: u64, mtime: u64) -> IoResult<()>

fn timer_init(&mut self) -> IoResult<~RtioTimer<Send>>

fn spawn(&mut self, config: ProcessConfig) -> IoResult<(~RtioProcess<Send>, ~[Option<~RtioPipe<Send>>])>

fn kill(&mut self, pid: pid_t, signal: int) -> IoResult<()>

fn pipe_open(&mut self, fd: c_int) -> IoResult<~RtioPipe<Send>>

fn tty_open(&mut self, fd: c_int, readable: bool) -> IoResult<~RtioTTY<Send>>

fn signal(&mut self, signal: Signum, channel: Sender<Signum>) -> IoResult<~RtioSignal<Send>>