Trait assert_fs::prelude::SymlinkToDir
source · pub trait SymlinkToDir {
// Required method
fn symlink_to_dir<P>(&self, target: P) -> Result<(), FixtureError>
where P: AsRef<Path>;
}
Expand description
Create a symlink to the target
Required Methods§
sourcefn symlink_to_dir<P>(&self, target: P) -> Result<(), FixtureError>where
P: AsRef<Path>,
fn symlink_to_dir<P>(&self, target: P) -> Result<(), FixtureError>where P: AsRef<Path>,
Create a symlink to the target
Examples
use assert_fs::prelude::*;
let temp = assert_fs::TempDir::new().unwrap();
let real_dir = temp.child("real_dir");
real_dir.create_dir_all().unwrap();
temp.child("link_dir").symlink_to_dir(real_dir.path()).unwrap();
temp.close().unwrap();