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

pub struct FS(_);

An in-memory struct that satisfies rsfs::GenFS.

FS is thread safe and copyable. It operates internally with an Arc<Mutex<FileSystem>> (FileSystem not being exported) and forces all filesystem calls to go through the mutex. FS attempts to mimic all real errors that could occur on a filesystem. Generally, unless a FS is setup with restrictive permissions, errors will only be encountered when operating on non-existent filesystem entries or performing invalid oprations.

See the module documentation or every struct's documentation for more examples of using an FS.

Examples

use rsfs::*;
use rsfs::mem::FS;

let fs = FS::new();

Methods

impl FS
[src]

Creates an empty FS with mode 0o777.

Examples

let fs = FS::new();

Creates an empty FS with the given mode.

Examples

let fs = FS::with_mode(0o300);

Trait Implementations

impl Clone for FS
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for FS
[src]

Formats the value using the given formatter.

impl Default for FS
[src]

Returns the "default value" for a type. Read more

impl GenFS for FS
[src]

The DirBuilder type in the same module implementing this trait.

The DirEntry type in the same module implementing this trait.

The File type in the same module implementing this trait.

The Metadata type in the same module implementing this trait.

The OpenOptions type in the same module implementing this trait.

The Permissions type in the same module implementing this trait.

The ReadDir type in the same module implementing this trait.

Returns the canonical form of a path with all intermediate components normalized and symbolic links resolved. Read more

Copies the contents of one file to another. This function will also copy the permission bits of the original file to the destination file. Read more

Creates a new, empty directory at the provided path. Read more

Recursively creates a directory and all its parent components if they are missing. Read more

Creates a new hard link on the filesystem. Read more

Returns metadata information of the file or directory at path. Read more

Returns an iterator over entries within a directory. Read more

Reads a symbolic link, returning the entry the link points to. Read more

Removes an existing, empty directory. Read more

Removes a directory at path after removing all of its contents. Read more

Removes a file from the filesystem. Read more

Renames a file or directory at from to to, replacing to if it exists. Read more

Changes the permissions of a file or directory. Read more

Query the metadata about a file without following symlinks. Read more

Returns a new OpenOptions for a file for this filesytem. Read more

Returns a new DirBuilder for a directory for this filesystem. Read more

Opens a file in read-only mode. Read more

Opens a file in write-only mode. Read more

impl GenFSExt for FS
[src]

Creates a new symbolic link on the filesystem. Read more