Struct ephemeral::Project

source ·
pub struct Project {
    pub path: PathBuf,
    /* private fields */
}
Expand description

Project represents a project created on the file system at any user-defined location defined by the path parameter to the new() function.

This struct as a builder so directories and files can be added to it. Remember to call build() at the end to create the project in the filesystem. The dirs vector will contain all the dirs & subdirs in the project, which are added when the directory is added to the project.

Fields§

§path: PathBuf

Implementations§

Creates a new Project at the specified path. This will automatically add a “root” directory to the dirs vector.

Creates the project in the filesystem. This will create all the directories & files that are added by using add_dir().

No function should be chained for this, except for clear().

Function panics if the directory or file cannot be created or written to.

Adds a directory to the chain which will be created when build() is called. This accepts a Dir, with the files already attached to it.

To add a subdirectory, specify the path from the project root.

To add files to the root of a directory, you need to call add_dir() and give a path which matches the project path.

Deletes the project from the filesystem. This function can be used to clear the project after running the tests.

This function panics if a directory cannot be deleted.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.