Struct mktemp::Temp [] [src]

pub struct Temp { /* fields omitted */ }

Methods

impl Temp
[src]

Create a temporary directory.

Create a new temporary directory in an existing directory

Create a new temporary file in an existing directory

Create a temporary file.

Return this temporary file or directory as a PathBuf.

Examples

use mktemp::Temp;

let temp_dir = Temp::new_dir().unwrap();
let mut path_buf = temp_dir.to_path_buf();

Release ownership of the temporary file or directory.

Examples

use mktemp::Temp;
let path_buf;
{
  let mut temp_dir = Temp::new_dir().unwrap();
  path_buf = temp_dir.to_path_buf();
  temp_dir.release();
}
assert!(path_buf.exists());

Trait Implementations

impl Clone for Temp
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl AsRef<Path> for Temp
[src]

Performs the conversion.

impl Drop for Temp
[src]

A method called when the value goes out of scope. Read more