Skip to content

szatanjl/template-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Project Template

This is a template for Rust project. Use it as a starting point to quickly set up your own project with a standardized structure, build process, and development workflow.

To begin:

  1. Change project_name in Cargo.toml, Makefile, .dockerignore, and .gitignore
  2. Configure repository files in .github/ directory
  3. Update Cargo.toml
  4. Optionally remove Cargo.lock from make distclean, .dockerignore, and .gitignore if you want to lock particular dependencies versions
  5. Update LICENSE and all mentions of it (grep LICENSE)
  6. Update contact information and email addresses (grep @example.com)
  7. Edit this README and replace all <...> placeholders
  8. Start your project

Note: Project name must only contain ASCII lowercase letters, digits, periods, and hyphens. It must start with a letter, must not end with a period nor hyphen, and must not contain two adjacent periods nor hyphens.

Regex: [a-z]([-.]?[0-9a-z]+)*

Rationale: This is the most portable naming convention that is also human and machine friendly.

  • It is compatible with most character sets and encodings: ASCII, Unicode, UTF-8, base64-url
  • It is case-insensitive
  • It can be used as a filename on most filesystems It is compatible with POSIX portable filename character set
  • It is URL-safe
  • It is compatible with docker image naming convention
  • It is compatible with make, shell, markdown, and other programming and markup languages. No spaces, or any special characters which could be problematic to handle
  • It can be used as an identifier in programming languages. May only require changing a hyphen ('-') to an underscore ('_')

Installation

Download pre-compiled binary package. See changelog for details.

Build and Install from Source

  1. Install build dependencies (these can be removed after build)

    • make
    • rust + cargo (>= 1.56)
  2. Download and extract source code

    # packages available also in .tar.zst and .zip formats
    curl -LO https://<URL>/<PKGNAME>/download/<PKGNAME>.src.tar.gz
    tar -xzf <PKGNAME>.src.tar.gz
    
  3. Build and install

    cd <PKGNAME>
    make CARGO_FLAGS=-r
    make install
    

Run Using Docker

docker pull <REGISTRY>/<PKGNAME>
docker run -it --rm <REGISTRY>/<PKGNAME>

Quick Start

Basic configuration. Usage examples.

See documentation for details.

Why?

Why use this software? Comparison with other similar projects.

How It Works?

How does it work?

Development

  1. Install required dependencies

    • rust + cargo (>= 1.56)
    • git
  2. Install optional dependencies

    • sh: Run make scripts
    • make: Build using make, which wraps cargo commands and adds more
    • docker: Build docker image
  3. Clone repository

    git clone --recurse-submodules https://<URL>/<PKGNAME>.git
    
  4. Configure make

  5. Build and run project

    cargo run
    

See documentation for details.

Questions

Before asking a question, check out documentation and issues labeled "question".

Cannot find answer you are looking for? Submit an issue or write an email to questions@example.com.

Contributing

Found a security vulnerability? Read security policy.

Found a bug? Missing a feature? Want to help? Read contribution guidelines.

License

This project is licensed under the MIT license.