pub trait UnixFileSystem {
// Required methods
fn mode<P: AsRef<Path>>(&self, path: P) -> Result<u32>;
fn set_mode<P: AsRef<Path>>(&self, path: P, mode: u32) -> Result<()>;
fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
src: P,
dst: Q,
) -> Result<()>;
fn get_symlink_src<P: AsRef<Path>>(&self, dst: P) -> Result<PathBuf>;
}
Required Methods§
Sourcefn mode<P: AsRef<Path>>(&self, path: P) -> Result<u32>
fn mode<P: AsRef<Path>>(&self, path: P) -> Result<u32>
Returns the current mode bits of path
.
§Errors
path
does not exist.- Current user has insufficient permissions.
Sourcefn symlink<P: AsRef<Path>, Q: AsRef<Path>>(&self, src: P, dst: Q) -> Result<()>
fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(&self, src: P, dst: Q) -> Result<()>
Creates a new symbolic link on the filesystem.
The dst
path will be a symbolic link pointing to the src
path.
Based on std::os::unix::fs::symlink
.
Sourcefn get_symlink_src<P: AsRef<Path>>(&self, dst: P) -> Result<PathBuf>
fn get_symlink_src<P: AsRef<Path>>(&self, dst: P) -> Result<PathBuf>
Gets the source for a symlink.
Based on std::fs::read_link
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.