pub struct DirSwitch { /* private fields */ }
Expand description

RIIA directory change object.

Creating an instance of this object represents storing the current directory and then switching to the requested directory. Dropping it causes the directory to be switched back to the original directory.

Notes

There’s no ergonomic way to return errors from Drop handlers. If it is unable switch back to the original directory, this will be lost to the application, although an error will be printed on stderr.

Implementations

Switch the current directory, and prepare for returning to the original.

Trait Implementations

Return to the original directory.

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

Performs the conversion.

Performs the conversion.

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.