pub struct TempDir {
pub path: PathBuf,
/* private fields */
}Expand description
TempDir contains information about a created temporary directory and will remove the directory recursively after the object goes out of scope. This is a convenience structure over mkdir_temp results.
Fields§
§path: PathBufImplementations§
Source§impl TempDir
impl TempDir
Sourcepub fn new(pattern: &str) -> Result<Self>
pub fn new(pattern: &str) -> Result<Self>
new creates a new temporary directory in the default directory for temporary files. The new directory’s name is generated by adding a random string to the end of pattern. If pattern includes a “”, the random string replaces the last “” instead. The temporary directory will be removed when the object goes out of scope.
Sourcepub fn new_in_dir(dir: &Path, pattern: &str) -> Result<Self>
pub fn new_in_dir(dir: &Path, pattern: &str) -> Result<Self>
new_in_dir is the same as new, except that the directory dir is used instead
of the system directory for temporary files.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TempDir
impl RefUnwindSafe for TempDir
impl Send for TempDir
impl Sync for TempDir
impl Unpin for TempDir
impl UnwindSafe for TempDir
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more