How bembemm/rustlings works
Rustlings is a terminal-based Rust learning tool: learners choose an exercise, run it, inspect compiler/test/Clippy output, and advance as exercises pass. Its repository also provides initialization, exercise metadata and embedded assets, official solutions, and maintainer commands. The README documents the full curriculum through Async, quizzes, hints, and terminal UI. Several source excerpts are partial, so links between the main loop and unsampled runtime subsystems are omitted or marked unverified rather than inferred as definite calls.
Main entry points: main.rs Command Entry · dev.rs Developer Commands · state.rs Run Feedback · init.rs Project Initialization
Components 22
CLI Runtime
- Command Entry
src/main.rs - CLI Arguments
src/cli.rs - Exercise State
src/app_state.rs - Exercise Browser
src/list/state.rs - Watch Loop
src/watch.rs - Run Feedback
src/watch/state.rs - Exercise Runner
src/run.rs - Compile and Run
src/exercise.rs - Cargo Commands
src/cmd.rs - Editor Launch
src/editor.rs
Learning Content
- Exercise Metadata
src/info_file.rs - Embedded Assets
src/embedded.rs - Exercise Curriculum
exercises - Official Answers
solutions
Project Tools
- Project Initialization
src/init.rs - Cargo Bin Updates
src/cargo_toml.rs - Developer Commands
src/dev.rs - Exercise Checks
src/dev/check.rs - Community Project Setup
src/dev/new.rs - Project Update
src/dev/update.rs
Runtime Support
- Terminal Output
src/term.rs
Other components
- Learner
Connections 19
- Learner → Command Entry: runs CLI
README.md - Command Entry → Project Initialization: dispatches init
src/main.rs - Command Entry → Developer Commands: dispatches dev
src/main.rs - Command Entry → Exercise Runner: dispatches run
src/main.rs - Command Entry → CLI Arguments: parses options
src/main.rs - Command Entry → Exercise Metadata: loads metadata
src/main.rs - Command Entry → Exercise State: creates state
src/main.rs - Command Entry → Exercise Browser: starts browser
- Exercise Runner → Watch Loop: starts watch loop
- Watch Loop → Run Feedback: manages run state
src/watch.rs - Run Feedback → Compile and Run: runs current
src/watch/state.rs - Compile and Run → Cargo Commands: invokes Cargo
src/exercise.rs - Run Feedback → Terminal Output: renders feedback
- Project Initialization → Embedded Assets: writes assets
src/init.rs - Project Initialization → Cargo Bin Updates: updates manifest
src/init.rs - Embedded Assets → Exercise Curriculum: materializes exercises
src/embedded.rs - Developer Commands → Exercise Checks: dispatches check
src/dev.rs - Developer Commands → Community Project Setup: dispatches new
src/dev.rs - Developer Commands → Project Update: dispatches update
src/dev.rs