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: PathBufImplementations§
source§impl Project
impl Project
sourcepub fn new<T>(path: T) -> Projectwhere
T: Into<PathBuf> + Clone,
pub fn new<T>(path: T) -> Projectwhere
T: Into<PathBuf> + Clone,
Creates a new Project at the specified path. This will automatically add a “root” directory
to the dirs vector.
sourcepub fn build(self) -> Self
pub fn build(self) -> Self
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.