pub trait SymlinkToFile {
// Required method
fn symlink_to_file<P: AsRef<Path>>(
&self,
target: P,
) -> Result<(), FixtureError>;
}
Expand description
Create a symlink to a target file.
Required Methods§
Sourcefn symlink_to_file<P: AsRef<Path>>(&self, target: P) -> Result<(), FixtureError>
fn symlink_to_file<P: AsRef<Path>>(&self, target: P) -> Result<(), FixtureError>
Create a symlink to the provided target file.
§Examples
use camino_tempfile_ext::prelude::*;
let temp = Utf8TempDir::new().unwrap();
let real_file = temp.child("real_file");
real_file.touch().unwrap();
temp.child("link_file").symlink_to_file(real_file.as_path()).unwrap();
temp.close().unwrap();
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.