Struct std::old_io::pipe::PipeStreamUnstable [-] [+] [src]

pub struct PipeStream {
    // some fields omitted
}

A synchronous, in-memory pipe.

Methods

impl PipeStream

fn open(fd: c_int) -> IoResult<PipeStream>

Consumes a file descriptor to return a pipe stream that will have synchronous, but non-blocking reads/writes. This is useful if the file descriptor is acquired via means other than the standard methods.

This operation consumes ownership of the file descriptor and it will be closed once the object is deallocated.

Example

#![allow(unused_must_use)] extern crate libc; use std::old_io::pipe::PipeStream; fn main() { let mut pipe = PipeStream::open(libc::STDERR_FILENO); pipe.write(b"Hello, stderr!"); }
extern crate libc;

use std::old_io::pipe::PipeStream;

fn main() {
    let mut pipe = PipeStream::open(libc::STDERR_FILENO);
    pipe.write(b"Hello, stderr!");
}

fn pair() -> IoResult<PipePair>

Creates a pair of in-memory OS pipes for a unidirectional communication stream.

The structure returned contains a reader and writer I/O object. Data written to the writer can be read from the reader.

Errors

This function can fail to succeed if the underlying OS has run out of available resources to allocate a new pipe.

Trait Implementations

impl Clone for PipeStream

fn clone(&self) -> PipeStream

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

impl Reader for PipeStream

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 PipeStream

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 PipeStream

fn as_raw_fd(&self) -> Fd

impl AsRawFd for PipeStream

fn as_raw_fd(&self) -> Fd