Struct cfile::CFile [] [src]

pub struct CFile {
    // some fields omitted
}

A reference to an open stream on the filesystem.

An instance of a CFile can be read and/or written depending on what modes it was opened with. CFile also implement Seek to alter the logical cursor that the file contains internally.

Methods

impl CFile

fn from_raw(f: *mut FILE, owned: bool) -> Result<CFile>

Constructs a CFile from a raw pointer.

fn reopen(&self, filename: &str, mode: &str) -> Result<CFile>

opens the file whose name is the string pointed to by filename and associates the stream pointed to by stream with it.

The original stream (if it exists) is closed. The mode argument is used just as in the open() function.

Methods from Deref<Target=RawFile>

fn stream(&self) -> RawFilePtr

returns the raw pointer of the stream

Trait Implementations

impl Sync for CFile

impl Send for CFile

impl Deref for CFile

type Target = RawFile

fn deref(&self) -> &Self::Target

impl DerefMut for CFile

fn deref_mut(&mut self) -> &mut Self::Target

impl Stream for CFile

fn position(&self) -> Result<u64>

fn eof(&self) -> bool

fn errno(&self) -> i32

fn last_error(&self) -> Option<Error>

fn clear_error(&self)

fn file_name(&self) -> Result<PathBuf>

fn metadata(&self) -> Result<Metadata>

impl AsRawFd for CFile

fn as_raw_fd(&self) -> RawFd

impl IntoRawFd for CFile

fn into_raw_fd(self) -> RawFd

impl Read for CFile

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

1.0.0fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

1.0.0fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

1.6.0fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

1.0.0fn by_ref(&mut self) -> &mut Self

1.0.0fn bytes(self) -> Bytes<Self>

fn chars(self) -> Chars<Self>

1.0.0fn chain<R>(self, next: R) -> Chain<Self, R> where R: Read

1.0.0fn take(self, limit: u64) -> Take<Self>

impl Write for CFile

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

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

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

1.0.0fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>

1.0.0fn by_ref(&mut self) -> &mut Self

impl Seek for CFile

fn seek(&mut self, pos: SeekFrom) -> Result<u64>

impl Debug for CFile

fn fmt(&self, f: &mut Formatter) -> Result

impl<'a> FileLockExt for CFile

fn lock(&mut self) -> FileLock

fn try_lock(&mut self) -> Option<FileLock>

fn unlock(&self)