Struct cfile::CFile [] [src]

pub struct CFile { /* 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
[src]

Constructs a CFile from a raw pointer.

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>

returns the raw pointer of the stream

Trait Implementations

impl Sync for CFile
[src]

impl Send for CFile
[src]

impl Deref for CFile
[src]

The resulting type after dereferencing

The method called to dereference a value

impl DerefMut for CFile
[src]

The method called to mutably dereference a value

impl Stream for CFile
[src]

returns the current position of the stream.

tests the end-of-file indicator for the stream

tests the error indicator for the stream

get the last error of the stream

clears the end-of-file and error indicators for the stream

returns the file name of the stream

Queries metadata about the underlying file.

impl AsRawFd for CFile
[src]

Extracts the raw file descriptor. Read more

impl IntoRawFd for CFile
[src]

Consumes this object, returning the raw underlying file descriptor. Read more

impl Read for CFile
[src]

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Creates a "by reference" adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

🔬 This is a nightly-only experimental API. (io)

the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an Iterator over chars. Read more

Creates an adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

impl Write for CFile
[src]

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more

impl Seek for CFile
[src]

Seek to an offset, in bytes, in a stream. Read more

impl Debug for CFile
[src]

Formats the value using the given formatter.

impl<'a> FileLockExt for CFile
[src]

acquires an exclusive lock on the specified object. Read more

a non-blocking version of lock(); Read more

releases the lock on an object acquired by an earlier call to lock() or try_lock(). Read more