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
sourceimpl Dir
impl Dir
sourcepub fn new(prefix: &str) -> Result<Dir>
pub fn new(prefix: &str) -> Result<Dir>
This is a shortcut version of new_in, which just creates the directory within the system’s default temporary directory.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Dir
impl Send for Dir
impl Sync for Dir
impl Unpin for Dir
impl UnwindSafe for Dir
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more