Struct std::old_io::net::pipe::UnixStreamUnstable [-] [+] [src]

pub struct UnixStream {
    // some fields omitted
}

A stream which communicates over a named pipe.

Methods

impl UnixStream

fn connect<P: BytesContainer>(path: P) -> IoResult<UnixStream>

Connect to a pipe named by path. This will attempt to open a connection to the underlying socket.

The returned stream will be closed when the object falls out of scope.

Example

fn main() { #![allow(unused_must_use)] use std::old_io::net::pipe::UnixStream; let server = Path::new("path/to/my/socket"); let mut stream = UnixStream::connect(&server); stream.write(&[1, 2, 3]); }
use std::old_io::net::pipe::UnixStream;

let server = Path::new("path/to/my/socket");
let mut stream = UnixStream::connect(&server);
stream.write(&[1, 2, 3]);

fn connect_timeout<P>(path: P, timeout: Duration) -> IoResult<UnixStream> where P: BytesContainer

Connect to a pipe named by path, timing out if the specified number of milliseconds.

This function is similar to connect, except that if timeout elapses the function will return an error of kind TimedOut.

If a timeout with zero or negative duration is specified then the function returns Err, with the error kind set to TimedOut.

fn close_read(&mut self) -> IoResult<()>

Closes the reading half of this connection.

This method will close the reading portion of this connection, causing all pending and future reads to immediately return with an error.

Note that this method affects all cloned handles associated with this stream, not just this one handle.

fn close_write(&mut self) -> IoResult<()>

Closes the writing half of this connection.

This method will close the writing portion of this connection, causing all pending and future writes to immediately return with an error.

Note that this method affects all cloned handles associated with this stream, not just this one handle.

fn set_timeout(&mut self, timeout_ms: Option<u64>)

Sets the read/write timeout for this socket.

For more information, see TcpStream::set_timeout

fn set_read_timeout(&mut self, timeout_ms: Option<u64>)

Sets the read timeout for this socket.

For more information, see TcpStream::set_timeout

fn set_write_timeout(&mut self, timeout_ms: Option<u64>)

Sets the write timeout for this socket.

For more information, see TcpStream::set_timeout

Trait Implementations

impl Clone for UnixStream

fn clone(&self) -> UnixStream

fn clone_from(&mut self, source: &Self)

impl Reader for UnixStream

fn read(&mut self, buf: &mut [u8]) -> IoResult<usize>

fn read_at_least(&mut self, min: usize, buf: &mut [u8]) -> IoResult<usize>

fn read_byte(&mut self) -> IoResult<u8>

fn push(&mut self, len: usize, buf: &mut Vec<u8>) -> IoResult<usize>

fn push_at_least(&mut self, min: usize, len: usize, buf: &mut Vec<u8>) -> IoResult<usize>

fn read_exact(&mut self, len: usize) -> IoResult<Vec<u8>>

fn read_to_end(&mut self) -> IoResult<Vec<u8>>

fn read_to_string(&mut self) -> IoResult<String>

fn read_le_uint_n(&mut self, nbytes: usize) -> IoResult<u64>

fn read_le_int_n(&mut self, nbytes: usize) -> IoResult<i64>

fn read_be_uint_n(&mut self, nbytes: usize) -> IoResult<u64>

fn read_be_int_n(&mut self, nbytes: usize) -> IoResult<i64>

fn read_le_uint(&mut self) -> IoResult<usize>

fn read_le_int(&mut self) -> IoResult<isize>

fn read_be_uint(&mut self) -> IoResult<usize>

fn read_be_int(&mut self) -> IoResult<isize>

fn read_be_u64(&mut self) -> IoResult<u64>

fn read_be_u32(&mut self) -> IoResult<u32>

fn read_be_u16(&mut self) -> IoResult<u16>

fn read_be_i64(&mut self) -> IoResult<i64>

fn read_be_i32(&mut self) -> IoResult<i32>

fn read_be_i16(&mut self) -> IoResult<i16>

fn read_be_f64(&mut self) -> IoResult<f64>

fn read_be_f32(&mut self) -> IoResult<f32>

fn read_le_u64(&mut self) -> IoResult<u64>

fn read_le_u32(&mut self) -> IoResult<u32>

fn read_le_u16(&mut self) -> IoResult<u16>

fn read_le_i64(&mut self) -> IoResult<i64>

fn read_le_i32(&mut self) -> IoResult<i32>

fn read_le_i16(&mut self) -> IoResult<i16>

fn read_le_f64(&mut self) -> IoResult<f64>

fn read_le_f32(&mut self) -> IoResult<f32>

fn read_u8(&mut self) -> IoResult<u8>

fn read_i8(&mut self) -> IoResult<i8>

impl Writer for UnixStream

fn write_all(&mut self, buf: &[u8]) -> IoResult<()>

fn write(&mut self, buf: &[u8]) -> IoResult<()>

fn flush(&mut self) -> IoResult<()>

fn write_fmt(&mut self, fmt: Arguments) -> IoResult<()>

fn write_str(&mut self, s: &str) -> IoResult<()>

fn write_line(&mut self, s: &str) -> IoResult<()>

fn write_char(&mut self, c: char) -> IoResult<()>

fn write_int(&mut self, n: isize) -> IoResult<()>

fn write_uint(&mut self, n: usize) -> IoResult<()>

fn write_le_uint(&mut self, n: usize) -> IoResult<()>

fn write_le_int(&mut self, n: isize) -> IoResult<()>

fn write_be_uint(&mut self, n: usize) -> IoResult<()>

fn write_be_int(&mut self, n: isize) -> IoResult<()>

fn write_be_u64(&mut self, n: u64) -> IoResult<()>

fn write_be_u32(&mut self, n: u32) -> IoResult<()>

fn write_be_u16(&mut self, n: u16) -> IoResult<()>

fn write_be_i64(&mut self, n: i64) -> IoResult<()>

fn write_be_i32(&mut self, n: i32) -> IoResult<()>

fn write_be_i16(&mut self, n: i16) -> IoResult<()>

fn write_be_f64(&mut self, f: f64) -> IoResult<()>

fn write_be_f32(&mut self, f: f32) -> IoResult<()>

fn write_le_u64(&mut self, n: u64) -> IoResult<()>

fn write_le_u32(&mut self, n: u32) -> IoResult<()>

fn write_le_u16(&mut self, n: u16) -> IoResult<()>

fn write_le_i64(&mut self, n: i64) -> IoResult<()>

fn write_le_i32(&mut self, n: i32) -> IoResult<()>

fn write_le_i16(&mut self, n: i16) -> IoResult<()>

fn write_le_f64(&mut self, f: f64) -> IoResult<()>

fn write_le_f32(&mut self, f: f32) -> IoResult<()>

fn write_u8(&mut self, n: u8) -> IoResult<()>

fn write_i8(&mut self, n: i8) -> IoResult<()>

impl AsRawFd for UnixStream

fn as_raw_fd(&self) -> Fd

impl AsRawFd for UnixStream

fn as_raw_fd(&self) -> Fd