Struct rsfs::disk::FS
[−]
[src]
pub struct FS;
An empty struct that satisfies rsfs::FS
by calling std::fs
functions.
Because this is an empty struct, it is inherently thread safe and copyable. The power of using
rsfs
comes from the ability to choose what filesystem you want to use where: your main can
use a disk backed filesystem, but your tests can use a test filesystem with injected errors.
Alternatively, the in-memory filesystem could suit your needs without forcing you to use disk.
Examples
use rsfs::*; let fs = rsfs::disk::FS;
Trait Implementations
impl Copy for FS
[src]
impl Clone for FS
[src]
fn clone(&self) -> FS
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for FS
[src]
impl GenFS for FS
[src]
type DirBuilder = DirBuilder
The DirBuilder
type in the same module implementing this trait.
type DirEntry = DirEntry
The DirEntry
type in the same module implementing this trait.
type File = File
The File
type in the same module implementing this trait.
type Metadata = Metadata
The Metadata
type in the same module implementing this trait.
type OpenOptions = OpenOptions
The OpenOptions
type in the same module implementing this trait.
type Permissions = Permissions
The Permissions
type in the same module implementing this trait.
type ReadDir = ReadDir
The ReadDir
type in the same module implementing this trait.
fn canonicalize<P: AsRef<Path>>(&self, path: P) -> Result<PathBuf>
Returns the canonical form of a path with all intermediate components normalized and symbolic links resolved. Read more
fn copy<P: AsRef<Path>, Q: AsRef<Path>>(&self, from: P, to: Q) -> Result<u64>
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
fn create_dir<P: AsRef<Path>>(&self, path: P) -> Result<()>
Creates a new, empty directory at the provided path. Read more
fn create_dir_all<P: AsRef<Path>>(&self, path: P) -> Result<()>
Recursively creates a directory and all its parent components if they are missing. Read more
fn hard_link<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
src: P,
dst: Q
) -> Result<()>
&self,
src: P,
dst: Q
) -> Result<()>
Creates a new hard link on the filesystem. Read more
fn metadata<P: AsRef<Path>>(&self, path: P) -> Result<Self::Metadata>
Returns metadata information of the file or directory at path. Read more
fn read_dir<P: AsRef<Path>>(&self, path: P) -> Result<Self::ReadDir>
Returns an iterator over entries within a directory. Read more
fn read_link<P: AsRef<Path>>(&self, path: P) -> Result<PathBuf>
Reads a symbolic link, returning the entry the link points to. Read more
fn remove_dir<P: AsRef<Path>>(&self, path: P) -> Result<()>
Removes an existing, empty directory. Read more
fn remove_dir_all<P: AsRef<Path>>(&self, path: P) -> Result<()>
Removes a directory at path after removing all of its contents. Read more
fn remove_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
Removes a file from the filesystem. Read more
fn rename<P: AsRef<Path>, Q: AsRef<Path>>(&self, from: P, to: Q) -> Result<()>
Renames a file or directory at from
to to
, replacing to
if it exists. Read more
fn set_permissions<P: AsRef<Path>>(
&self,
path: P,
perm: Self::Permissions
) -> Result<()>
&self,
path: P,
perm: Self::Permissions
) -> Result<()>
Changes the permissions of a file or directory. Read more
fn symlink_metadata<P: AsRef<Path>>(&self, path: P) -> Result<Self::Metadata>
Query the metadata about a file without following symlinks. Read more
fn new_openopts(&self) -> Self::OpenOptions
Returns a new OpenOptions for a file for this filesytem. Read more
fn new_dirbuilder(&self) -> Self::DirBuilder
Returns a new DirBuilder for a directory for this filesystem. Read more
fn open_file<P: AsRef<Path>>(&self, path: P) -> Result<Self::File>
Opens a file in read-only mode. Read more
fn create_file<P: AsRef<Path>>(&self, path: P) -> Result<Self::File>
Opens a file in write-only mode. Read more