Struct rustc_back::tempdir::TempDir [] [src]

pub struct TempDir { /* fields omitted */ }
🔬 This is a nightly-only experimental API. (rustc_private)

A wrapper for a path to temporary directory implementing automatic scope-based deletion.

Methods

impl TempDir
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

Attempts to make a temporary directory inside of tmpdir whose name will have the prefix prefix. The directory will be automatically deleted once the returned wrapper is destroyed.

If no directory can be created, Err is returned.

🔬 This is a nightly-only experimental API. (rustc_private)

Attempts to make a temporary directory inside of env::temp_dir() whose name will have the prefix prefix. The directory will be automatically deleted once the returned wrapper is destroyed.

If no directory can be created, Err is returned.

🔬 This is a nightly-only experimental API. (rustc_private)

Unwrap the wrapped std::path::Path from the TempDir wrapper. This discards the wrapper so that the automatic deletion of the temporary directory is prevented.

🔬 This is a nightly-only experimental API. (rustc_private)

Access the wrapped std::path::Path to the temporary directory.

🔬 This is a nightly-only experimental API. (rustc_private)

Close and remove the temporary directory

Although TempDir removes the directory on drop, in the destructor any errors are ignored. To detect errors cleaning up the temporary directory, call close instead.

Trait Implementations

impl Drop for TempDir
[src]

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