camino_tempfile_ext/fixture/
mod.rs

1// Copyright (c) The camino-tempfile Contributors
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! Support for easy creation of temporary files and directories inside a
5//! [`Utf8TempDir`].
6//!
7//! Creation of files inside temporary directories, especially ones inside
8//! subdirectories, can be a bit bothersome to do by hand. This module provides
9//! convenient ways to create these files.
10//!
11//! # Examples
12//!
13//! ```
14//! use camino_tempfile_ext::prelude::*;
15//!
16//! // Create a temporary directory.
17//! let dir = Utf8TempDir::new().unwrap();
18//!
19//! // Create a nested file within this directory. Creation of intermediate
20//! // directories is automatic.
21//! let file = dir.child("foo/bar/baz.txt");
22//! file.write_str("Hello, world!").unwrap();
23//!
24//! // Now do something with the file...
25//! # #[cfg(feature = "assert")]
26//! # file.assert("Hello, world!");
27//! ```
28//!
29//! [`Utf8TempDir`]: camino_tempfile::Utf8TempDir
30
31mod child;
32mod errors;
33mod tools;
34
35pub use child::*;
36pub use errors::*;
37pub use tools::*;