Module fixture

Source
Expand description

Support for easy creation of temporary files and directories inside a Utf8TempDir.

Creation of files inside temporary directories, especially ones inside subdirectories, can be a bit bothersome to do by hand. This module provides convenient ways to create these files.

§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();

// Now do something with the file...

Structs§

ChildPath
A path within a temporary directory.
FixtureError
Failure when initializing the fixture.

Enums§

FixtureKind
Fixture initialization cause.

Traits§

FileTouch
Create empty files at ChildPath.
FileWriteBin
Write a binary file at ChildPath.
FileWriteFile
Write (copy) a file to ChildPath.
FileWriteStr
Write a text file at a ChildPath or NamedUtf8TempFile.
PathChild
Access paths within a Utf8TempDir for testing.
PathCopy
Copy files into Utf8TempDir.
PathCreateDir
Create empty directories at ChildPath.
SymlinkToDir
Create a symlink to a target directory.
SymlinkToFile
Create a symlink to a target file.