Struct mktemp::Temp
[−]
[src]
pub struct Temp { /* fields omitted */ }
Methods
impl Temp
[src]
fn new_dir() -> Result<Self>
Create a temporary directory.
fn new_dir_in(directory: &Path) -> Result<Self>
Create a new temporary directory in an existing directory
fn new_file_in(directory: &Path) -> Result<Self>
Create a new temporary file in an existing directory
fn new_file() -> Result<Self>
Create a temporary file.
fn to_path_buf(&self) -> PathBuf
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();
fn release(&mut self)
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]
fn clone(&self) -> Temp
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more