pub struct BijouFs { /* private fields */ }Expand description
High level wrapper for Bijou.
Implementations§
Source§impl BijouFs
impl BijouFs
Sourcepub fn create_dir(&self, path: impl AsRef<Path>) -> Result<()>
pub fn create_dir(&self, path: impl AsRef<Path>) -> Result<()>
Creates a new, empty directory at the provided path.
This corresponds to std::fs::create_dir.
Sourcepub fn create_dir_all(&self, path: impl AsRef<Path>) -> Result<()>
pub fn create_dir_all(&self, path: impl AsRef<Path>) -> Result<()>
Recursively creates a directory and all of its parent components if they are missing.
This corresponds to std::fs::create_dir_all.
Sourcepub fn hard_link(
&self,
original: impl AsRef<Path>,
link: impl AsRef<Path>,
) -> Result<()>
pub fn hard_link( &self, original: impl AsRef<Path>, link: impl AsRef<Path>, ) -> Result<()>
Creates a new hard link on the filesystem.
This corresponds to std::fs::hard_link.
Sourcepub fn metadata(&self, path: impl AsRef<Path>) -> Result<FileMeta>
pub fn metadata(&self, path: impl AsRef<Path>) -> Result<FileMeta>
Given a path, queries the file system to get information about a file, directory, etc.
This corresponds to std::fs::metadata.
Sourcepub fn read(&self, path: impl AsRef<Path>) -> Result<Vec<u8>>
pub fn read(&self, path: impl AsRef<Path>) -> Result<Vec<u8>>
Reads the entire contents of a file into a bytes vector.
This corresponds to std::fs::read.
Sourcepub fn read_dir(
&self,
path: impl AsRef<Path>,
) -> Result<impl Iterator<Item = Result<(String, DirItem)>> + '_>
pub fn read_dir( &self, path: impl AsRef<Path>, ) -> Result<impl Iterator<Item = Result<(String, DirItem)>> + '_>
Returns an iterator over the entries within a directory.
This corresponds to std::fs::read_dir.
Sourcepub fn read_link(&self, path: impl AsRef<Path>) -> Result<PathBuf>
pub fn read_link(&self, path: impl AsRef<Path>) -> Result<PathBuf>
Reads a symbolic link, returning the file that the link points to.
This corresponds to std::fs::read_link.
Sourcepub fn read_to_string(&self, path: impl AsRef<Path>) -> Result<String>
pub fn read_to_string(&self, path: impl AsRef<Path>) -> Result<String>
Reads the entire contents of a file into a string.
This corresponds to std::fs::read_to_string.
Sourcepub fn remove(&self, path: impl AsRef<Path>) -> Result<()>
pub fn remove(&self, path: impl AsRef<Path>) -> Result<()>
Removes an empty directory (or file).
This corresponds to std::fs::remove_file and std::fs::remove_dir.
Sourcepub fn remove_all(&self, path: impl AsRef<Path>) -> Result<()>
pub fn remove_all(&self, path: impl AsRef<Path>) -> Result<()>
Removes a directory at this path, after removing all its contents.
This corresponds to std::fs::remove_dir_all.
Sourcepub fn rename(&self, from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()>
pub fn rename(&self, from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()>
Rename a file or directory to a new name, replacing the original file if to already exists.
This corresponds to std::fs::rename.
Sourcepub fn soft_link(
&self,
original: impl AsRef<Path>,
link: impl AsRef<Path>,
) -> Result<()>
pub fn soft_link( &self, original: impl AsRef<Path>, link: impl AsRef<Path>, ) -> Result<()>
Creates a new symbolic link on the filesystem.
This corresponds to std::fs::hard_link.
Sourcepub fn symlink_metadata(&self, path: impl AsRef<Path>) -> Result<FileMeta>
pub fn symlink_metadata(&self, path: impl AsRef<Path>) -> Result<FileMeta>
Query the metadata about a file without following symlinks.
This corresponds to std::fs::symlink_metadata.