Skip to content

taurr/rust-template-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-template-rs

Here are a few templates for use when creating Rust applications.

The templates take full advantage of cargo-generate subtemplates, thust the repo contains both project templates and several smaller templates that are used to add functionality to an already existing project.

Project templates

Project templates have optional support for generating IDE scaffolding (currently only Vscode, contributions for others are welcome).

Workspace

Simple setup for a base workspace, ready to put your projects in.

Cli

Binary with a command line (clap) interface.

Template is setup to use:

Lib

Library crate.

The library will be setup for use with:

Snippets

Several templates are included that function as snippets that integrate into in existing project.

Just try and expand the template repository and let cargo-generate guide you.

Tips'n'tricks

If the template is used on a regular basis, cargo-generate allows to setup favorite templates and default variables.

To do this, open or create the file $CARGO_HOME/cargo-generate.toml, insert this:

[values]
gh_username = "your username on github.com"
ide = "none|vscode"

[favorites.rust]
git = "https://github.com/taurr/rust-template-rs"
subfolder = "Projects"

[favorites.snippet]
git = "https://github.com/taurr/rust-template-rs"
subfolder = "Snippets"

After this, the template can be expanded using a simple:

cargo generate rust

or:

cargo generate snippet

About

Misc Rust templates for use with `cargo-generate`

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages