Struct mktemp::TempDir

source ·
pub struct TempDir { /* private fields */ }
Expand description

A temporary directory

Implementations

Creates a new temporary directory with the given prefix

Errors

Any of the following will produce errors:

  • Failure to parse a CString from the given data
  • mkdtemp returning NULL
Examples
use std::fs;
use mktemp::TempDir;

let td = TempDir::new("my-groovy-tempdir-").unwrap();
assert!(fs::metadata(td.path()).is_ok());

Return the path to the temporary directory

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.