Trait assert_fs::PathChild[][src]

pub trait PathChild {
    fn child<P>(&self, path: P) -> ChildPath
    where
        P: AsRef<Path>
; }

Access paths within TempDir for testing.

See ChildPath Trait Implementations.

use assert_fs::prelude::*;

let temp = assert_fs::TempDir::new().unwrap();
let input_file = temp.child("foo.txt");
input_file.touch().unwrap();
temp.close().unwrap();

Required Methods

Create a path within the temp directory.

Examples

use assert_fs::prelude::*;

let temp = assert_fs::TempDir::new().unwrap();
println!("{:?}", temp.path());
println!("{:?}", temp.child("foo/bar.txt").path());
temp.close().unwrap();

Implementors