Struct rsfs::mem::unix::File [] [src]

pub struct File { /* fields omitted */ }

A view into a file on the filesystem.

An instance of File can be read or written to depending on the options it was opened with. Files also implement Seek to alter the logical cursor position of the internal file.

This struct implements rsfs::File and has unix extensions.

Examples

let fs = FS::new();
let mut f = fs.create_file("f")?;
assert_eq!(f.write(&[1, 2, 3])?, 3);

Trait Implementations

impl Debug for File
[src]

Formats the value using the given formatter.

impl File for File
[src]

The Metadata type in the same module implementing this trait.

The Permissions type in the same module implementing this trait.

Attempts to sync all OS-internal metadata to the filesystem. Read more

This function is similar to [sync_all], except that it may not synchronize metadata to the filesystem. Read more

Truncates or extends the underlying file, updating the size of this file to become size. Read more

Queries information about the underlying file. Read more

Generates a new, independently owned handle to the underlying file. Read more

Changes the permissions on the underlying file. 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

🔬 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 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 Seek for File
[src]

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

impl<'a> Read for &'a 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

🔬 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<'a> Write for &'a 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<'a> Seek for &'a File
[src]

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

impl FileExt for File
[src]

Reads a number of bytes starting from the given offset, returning the number of bytes read. Read more

Writes a number of bytes starting from the given offset, returning the number of bytes written. Read more