Learn Rust with babar
This optional track is for readers who want to learn Rust by reading real babar code and docs examples instead of detouring through toy applications. The opening sequence is aimed at readers who know how to program already and now need a trustworthy way to read Rust in context.
Opening guided sequence
These first five chapters are meant to be read in order:
- Read a babar program
- Syntax and control flow in context
- Types, structs, and
Result - Ownership and borrowing around queries
- Async/await and the driver task mental model
Together they answer the first questions most new Rust readers hit when they open babar for the first time:
- What parts of this file are data shapes versus I/O?
- How do the statement types describe the database boundary?
- Why do
&,clone(),Option<T>,.await, and?appear so often? - What async mental model is enough to keep reading without studying runtime internals yet?
Follow-on chapters
The remaining chapters deepen that foundation without turning this docs site into a general Rust textbook:
- Error handling and service boundaries
- Traits, generics, and codecs
- Structs,
impl, and Rust-flavored OOP - Iterators, closures, and functional style
How the guided pages are framed
Each chapter in this section follows the same pattern:
- babar anchor — start from a real
babarexample, docs page, or code path. - Rust-first explanation — explain the Rust concept directly in the context of that anchor.
- Python comparison (optional) — include a clearly labeled comparison only when it closes a real gap for Python-fluent readers.
- Checkpoint / reflection — end with a small self-check so you can tell whether the Rust idea is starting to stick.
Start here, then branch outward
If you want the shortest path through the opening sequence, read the five chapters above and keep these source anchors open in a second tab:
- Your first query
- 1. Connecting
- 2. Selecting
crates/core/examples/quickstart.rs
After that, jump outward only when you need more depth: