Documentation
- Introduction
- How the guides are organized
- Reading the guides offline
- Conventions used in these guides
- The complete index
- Writing documentation
Introduction
dust-framework ships its documentation with the framework. The same Markdown files you read on the website live in docs/ in the repository and in the installed crate, so a guide always matches the version your Cargo.lock resolved. You can read them in a browser, in your editor, or from the helper script in the agent skills.
This page explains how the guides are organized, how to find the right one, and how to read them without a network connection.
How the guides are organized
The guides follow the order you meet each idea while building an application:
- Getting started takes you from an empty machine to a running application.
- Architecture concepts explains how the pieces fit together before you use them.
- The basics covers the request path: routing, handlers, middleware, requests, responses, sessions, and errors.
- Frontend covers views, templates, and head metadata.
- Digging deeper covers the features you add once the basics work: queues, events, broadcasting, scheduling, packages, and more.
- Database and models cover storage.
- Security covers authentication, authorization, hashing, and encryption.
- Communication covers mail, notifications, SMS, and Slack.
- Utilities and testing cover the helpers and the test client.
If you are new to the framework, read Installation, then Directory Structure and Request Lifecycle. If you are looking for one feature, the index below and the search in your editor are faster than reading in order.
Reading the guides offline
The guides are plain Markdown with relative links, so they render in any editor or Markdown viewer that resolves links. dust new does not copy them into your application; the dust-framework crate packages them under its own docs/ directory instead. After Cargo fetches your dependencies, find that directory with:
ls "$CARGO_HOME/registry/src"/*/dust-framework-*/docsWhen you depend on a path checkout, read the checkout's docs/ instead. Open documentation.md there, or point your editor at the directory. Cross-links are relative, so they keep working offline as long as you keep the files together.
From the repository, the guides are also rendered into the documentation site by scripts/deploy and the docs build in scripts/docs. The source of truth is always the Markdown in docs/; the site is a rendering of it.
Conventions used in these guides
A few conventions keep the examples predictable:
- Examples are Rust unless a code fence says otherwise. A fence marked
shellruns in a terminal,htmlis a template,toml,ini,json, andtextare data or output. - Most Rust examples assume
use dust::prelude::*;, as the prelude guide explains. When an example needs another import, it shows it. - Examples that need a server, a database, or the network are marked
no_runin the crate documentation. Markdown examples are illustrative; run them in a test application when you adapt them. dustcommands run from the application's directory or any directory inside it, unless a section says otherwise.- Paths such as
src/app.rsare relative to the application's root, not to the framework repository.
The complete index
Getting Started
Architecture Concepts
The Basics
Frontend
Digging Deeper
Database
Models
Security
Communication
Utilities
Testing
Writing documentation
When you add a feature, add its guide in the same change. The repository's rules treat a feature without a guide as unfinished, and the guide is the place to record what the feature is for, not only how to call it.
A guide in docs/ follows the same shape:
- A title and a table of contents of the sections that follow.
- A short introduction that says why the feature exists and when to reach for it.
- One section per idea, with a runnable example and the failure modes that matter.
- Cross-links to the guides a reader needs next.
- Stable anchors on each section, so other guides can link to the exact part.
Write in the second person and the present tense: "you register a service", not "the service is registered by the user". Name the file, the command, and the type exactly as the code does. If the behavior differs from the inspiration snapshot, say so in the section and link to the guide that explains the difference.