Crate create

source ·


util 🔒


try 🔒
try 🔒


CreateArgs 🔒
Creates scaffolding for new projects.
A project path pointing to a non-existent leaf directory which will be the home of the new project. The project name is derived from the leaf directory.
StdFs 🔒
Standard library filesystem implementation of FileReader.
The arguments passed in during template execution. The fields defined here represent what variables can be present in template files. Add a field here and populate it to make it accessible in a template.


Language 🔒
Supported languages for project creation.
An in-memory representation of a file tree, where the paths and contents have all been executed and rendered into their final form. This is the mirror of TemplateTree.
The in-memory filtered template file tree.



FileReader 🔒
Trait to enable testing of the template tree creation logic. Allows mocking out reading from the file system.


Given a path to a JSON file, extract a list of template files that match the project_type and lang.
Returns true if the template file name begins with an _.
Returns true if this path is a single segment path, e.g. “foo.txt”.
main 🔒
Registers any partial templates (templates whose file names begin with _) with the templating engine.