You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Rust Cookbook is a collection of simple Rust examples that
demonstrate good practices to accomplish common programming tasks,
using the crates of the Rust ecosystem.
These examples are complete, and suitable for copying directly into
new cargo projects. They are tested and guaranteed to work.
The output can also be opened from the book subdirectory in your web browser.
$ xdg-open ./book/index.html # linux
$ start .\book\index.html # windows
$ open ./book/index.html # mac
Development
Local Development
For local development and testing, you can use the provided Makefile:
# Show all available commands
make help# Build the book locally
make build
# Run tests
make test# Build and test (development workflow)
make dev
# Serve the book locally with live reload
make serve
# Clean build artifacts
make clean
Deployment
As a maintainer, you can deploy the site locally using:
# Deploy to GitHub Pages (requires maintainer permissions)
make deploy
# Or use the script directly
./scripts/deploy.sh
The deployment script will:
Build and test the book
Push the built site to the gh-pages branch
GitHub Pages will automatically serve the updated site
Note: This requires maintainer permissions to push to the gh-pages branch.
Contributing
This project is intended to be easy for new Rust programmers to
contribute to, and an easy way to get involved with the Rust
community. It needs and welcomes help.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Rust Cookbook by you, as defined in the CC0-1.0 license, shall be
dedicated to the public domain and licensed as above, without any additional
terms or conditions.