Skip to content

Reloaded Rust Templates



Opinionated Rust project generators for libraries and binaries.
Built with cargo-generate.
Used by Sewer's Projects and the Reloaded-III framework.

About

This template repository provides opinionated Rust project generators for libraries and binaries using the cargo-generate tool.

These templates provide various features for getting up and running with cross platform Rust library or Reloaded3 mod development:

  • Standardized README, Contributing Guidelines & Project Layout
  • GitHub Issue and Pull Request templates
  • VSCode Workflow & Integration with sane defaults
  • Test, lint, audit, and code coverage via Codecov GitHub Action workflows
  • A choice of Apache, MIT, LGPLv3 or GPLv3 licenses
  • cargo-bench integration (optional)
  • Cross-compilation & testing; including testing for Wine on Linux (optional)
  • Profile Guided Optimization (optional)
  • Native C exports (optional), and C# exports

Project Templates

This repository contains two sub-templates:

  • general: for generating a rust library, webserver, or binary/executable project
  • reloaded3: for generating a Reloaded-III mod written in Rust. ~~2024~~, ~~2025~~, god knows

Getting Started

Install cargo-generate via cargo install cargo-generate, and create project from template:

# This might take a while
cargo install cargo-generate
cargo generate --git https://github.com/Reloaded-Project/reloaded-templates-rust.git

The above command requires user input. For avoiding user input (important for automated usage), try something like:

cargo generate \
  --git https://github.com/Reloaded-Project/reloaded-templates-rust.git \
  templates/general \
  --name my-project \
  --destination . \
  --define gh_username=YourUsername \
  --define gh_reponame=my-project \
  --define "project_description=A brief description of your project" \
  --define mkdocs=false \
  --define vscode=true \
  --define xplat=false \
  --define wine=false \
  --define bench=false \
  --define miri=false \
  --define fuzz=false \
  --define build_c_libs=false \
  --define build_cli=false \
  --define publish_crate_on_tag=true \
  --define license=MIT \
  --define no_std_support=STD

The --destination folder must already exist; it will not be auto-created.

More installation options are available here.

The experience running through the template should look something like this:

cargo-generate Rust Binary Application Screenshot

Once you generate a template, further instructions might await in your project's README file 😉.

Code Editor Setup

After generating a project, open the src folder in your code editor for development.

Visit the manual generated in your project's README for editor setup details.

Technical Questions

If you have questions/bug reports/etc. feel free to Open an Issue.

Happy Documenting ❤️