Struct native::io::file::FileDesc[src]

pub struct FileDesc {
    // some fields omitted
}

Methods

impl FileDesc

fn new(fd: fd_t, close_on_drop: bool) -> FileDesc

Create a FileDesc from an open C file descriptor.

The FileDesc will take ownership of the specified file descriptor and close it upon destruction if the close_on_drop flag is true, otherwise it will not close the file descriptor when this FileDesc is dropped.

Note that all I/O operations done on this object will be blocking, but they do not require the runtime to be active.

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

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

fn fd(&self) -> fd_t

Trait Implementations

impl RtioFileStream for FileDesc

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

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

fn pread(&mut self, buf: &mut [u8], offset: u64) -> IoResult<int>

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

fn seek(&mut self, pos: i64, whence: SeekStyle) -> IoResult<u64>

fn tell(&self) -> IoResult<u64>

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

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

fn truncate(&mut self, offset: i64) -> IoResult<()>

fn fstat(&mut self) -> IoResult<FileStat>

impl RtioPipe for FileDesc

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

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

fn clone(&self) -> Box<RtioPipe + Send>

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

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

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

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

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

impl RtioTTY for FileDesc

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

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

fn set_raw(&mut self, _raw: bool) -> IoResult<()>

fn get_winsize(&mut self) -> IoResult<(int, int)>

fn isatty(&self) -> bool