Trait PathCopy

Source
pub trait PathCopy {
    // Required method
    fn copy_from<P, S>(
        &self,
        source: P,
        patterns: &[S],
    ) -> Result<(), FixtureError>
       where P: AsRef<Path>,
             S: AsRef<str>;
}
Expand description

Copy files into TempDir.

Required Methods§

Source

fn copy_from<P, S>(&self, source: P, patterns: &[S]) -> Result<(), FixtureError>
where P: AsRef<Path>, S: AsRef<str>,

Copy files and directories into the current path from the source according to the glob patterns.

§Examples
use assert_fs::prelude::*;

let temp = assert_fs::TempDir::new().unwrap();
temp.copy_from(".", &["*.rs"]).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.

Implementors§