Struct bdrck::testing::temp::Dir

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

A directory within the system’s standard temp directory that is automatically deleted when it goes out of scope. The directory is created on construction.

NOTE: For various reasons (e.g. races), temporary directories and files can be very dangerous to rely upon in production code. This struct, as well as File which is based upon it, are primarily intended to be used for unit testing only (thus their placement in the testing submodule).

Implementations

This is a shortcut version of new_in, which just creates the directory within the system’s default temporary directory.

Return the path to this temporary directory.

A convenience function which adds the given relative path to this temporary directory’s absolute path.

“Close” this temporary directory, by deleting it along with all of its contents. This is called automatically by the Drop implementation, but it can also be called manually if you want to dispose of this instance without just letting it go out of scope.

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.