#temporary-files #extension #temp-dir #camino #temp-file

camino-tempfile-ext

Quality-of-life extensions for camino-tempfile

4 releases (2 breaking)

0.3.1 May 27, 2025
0.3.0 May 4, 2025
0.2.0 May 4, 2025
0.1.0 May 3, 2025

#636 in Filesystem

Download history 530/week @ 2025-05-02 1351/week @ 2025-05-09 1180/week @ 2025-05-16 1020/week @ 2025-05-23 1718/week @ 2025-05-30 1546/week @ 2025-06-06 1896/week @ 2025-06-13

6,474 downloads per month
Used in nextest-runner

MIT/Apache

130KB
1.5K SLoC

camino-tempfile-ext

crates.io Documentation (latest release) Documentation (main) License (Apache 2.0) License (MIT)

Quality-of-life extensions for camino-tempfile.

camino-tempfile-ext provides utilities for:

  • Creating files and directories within a Utf8TempDir.
  • Asserting on file and directory contents.

This crate is geared primarily towards testing and development, but it may be of use in production environments as well.

Examples

use camino_tempfile_ext::prelude::*;

// Create a temporary directory.
let dir = Utf8TempDir::new().unwrap();

// Create a nested file within this directory. Creation of intermediate
// directories is automatic.
let file = dir.child("foo/bar/baz.txt");
file.write_str("Hello, world!").unwrap();

// Assert on the file's contents (requires the assert feature)
file.assert("Hello, world!");

Features

  • assert: Enable assertions on file and directory contents. Not enabled by default.
  • assert-color: Enable colored output for assertions: enables assert. Not enabled by default.

Minimum supported Rust version (MSRV)

camino-tempfile-ext’s MSRV is Rust 1.74. At any time, at least the last 6 months of Rust releases will be supported.

Credits

Portions of camino-tempfile-ext have been adapted from assert_fs (thank you to the upstream maintainers!). If you need to work with std::path::Path rather than camino::Utf8Path, check out assert_fs.

Upstream code is used under the terms of the MIT and Apache 2.0 licenses.

License

This project is available under the terms of either the Apache 2.0 license or the MIT license.

Dependencies

~6–16MB
~227K SLoC