Function tempdir_in
fn tempdir_in<P: AsRef<std::path::Path>>(dir: P) -> Result<TempDir>
Create a new temporary directory in a specific directory. Also see tempdir.
The tempdir_in function creates a directory in the specified directory
and returns a TempDir.
The directory will be automatically deleted when the TempDirs
destructor is run.
Resource Leaking
See the resource leaking docs on TempDir.
Errors
If the directory can not be created, Err is returned.
Examples
use tempdir_in;
use File;
use Write;
// Create a directory inside of the current directory.
let tmp_dir = tempdir_in?;
let file_path = tmp_dir.path.join;
let mut tmp_file = create?;
writeln!?;
// `tmp_dir` goes out of scope, the directory as well as
// `tmp_file` will be deleted here.
drop;
tmp_dir.close?;
# Ok::