[−][src]Struct bdrck::testing::temp::Dir
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).
Methods
impl Dir
[src]
pub fn new(prefix: &str) -> Result<Dir>
[src]
This is a shortcut version of new_in, which just creates the directory within the system's default temporary directory.
pub fn path(&self) -> &Path
[src]
Return the path to this temporary directory.
pub fn sub_path<P: AsRef<Path>>(&self, path: P) -> Result<PathBuf>
[src]
A convenience function which adds the given relative path to this temporary directory's absolute path.
pub fn close(self) -> Result<()>
[src]
"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
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,