Struct mongodb::gridfs::file::File [] [src]

pub struct File {
    pub doc: GfsFile,
    // some fields omitted
}

A writable or readable file stream within GridFS.

Fields

The file document associated with this stream.

Methods

impl File
[src]

A new file stream with an id-referenced GridFS file.

A new file stream with a name-and-id-referenced GridFS file.

A new file stream from a read file document.

Returns the byte length of the file.

Returns true if the file contains no bytes.

Retrieves the description of the threaded error, if one occurred.

Ensures the file mode matches the desired mode.

Completes writing or reading and closes the file. This will be called when the file is dropped, but errors will be ignored. Therefore, this method should be called manually.

Methods from Deref<Target=GfsFile>

Converts a GfsFile into a bson document.

Trait Implementations

impl Deref for File
[src]

The resulting type after dereferencing

The method called to dereference a value

impl DerefMut for File
[src]

The method called to mutably dereference a value

impl Write for File
[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 Read for File
[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

Unstable (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 Drop for File
[src]

A method called when the value goes out of scope. Read more