An opinionated Rust project template for cargo generate that provides a robust foundation for both library and binary crates. This template extends rust-github/template with additional structure and features to support a wide range of development use cases - from simple utilities to complex applications with async capabilities, configuration management, and structured error handling.
Please review ARCHITECTURE.md for details about this template.
- Structured test organization: with examples of unit, integration, and doc tests
- Pre-commit hooks: for code quality enforcement
- Rust version explicit: specification via
.rust-versionfile - Modern Error Handling: Built-in
thiserrorandanyhowintegration with error type definitions - Command-Line Argument Parsing: Ready-to-use CLI setup with
clapderive feature - Configuration Management: Flexible config system (
config,serde) with environment variable support - Structured Logging: Preconfigured
tracingsetup for production-ready logging - Convenient Makefile: Common commands for build, test, lint, and documentation
- Async Support: Optional
tokioruntime integration for asynchronous applications - Time Handling: Date/time utilities with
chronointegration - Feature Flags: Conditional compilation for optional components like async and time utilities
- GitHub Actions: Sufficient workflows for testing, linting, coverate, and security auditing
Install cargo-generate if you don't have it already:
cargo install cargo-generateGenerate a new project:
cargo generate --git https://github.com/cdvel/scaffold-rsFollow the prompts to configure your project.
- Project type: Binary or library
- GitHub username: For repository links and documentation
- Project description: For Cargo.toml and documentation
MIT