Rullst AcademyRullst Academy/Lesson
Rust II: data, choices and confidence · Lesson 12 / 12

Your equipment workshop

Now the pieces work together: a validated catalogue, checkout, return, report and tests. Explain both success and a rejected attempt.

Learning paths20 min

Let's discover together

  1. 1

    Download the activity ZIP and extract it into a new folder. It includes Cargo.toml, src/main.rs, items.txt, README, workbook and GitHub guide. In the Cargo.toml folder run cargo test and cargo run --offline. There are no external dependencies.

  2. 2

    The program starts with sensor;3 and motor;2. It checks out one unit of the first item, tries to take 20, then returns one. The impossible request preserves state; the final report keeps file order.

  3. 3

    cargo run --offline -- items.txt reads your UTF-8 file. The parser accepts up to 20 unique names of 1 to 40 scalar values, with no controls or semicolons; quantities range from 1 to 20. Blank lines are ignored; one invalid record rejects the entire set.

  4. 4

    This is a local simulation without accounts, networking, a database or persistent checkouts. It reads and prints; it does not change items.txt. Save edits in your editor and record results in the workbook. The publishing panel sends one file at a time after confirmation.

FROM LESSON TO PRACTICE

A guide to follow at your pace

Read the steps before using the reference below. Commands run in the indicated system’s terminal; signup happens on the official site. Rullst Academy exercises are practice and do not verify your installation or external account.

fn main() {
    let total = 3_u16;
    let mut available = total;
    available -= 1;
    println!("{available}");
    let request = 20;
    if request <= available { available -= request; }
    println!("{available}");
    if available < total { available += 1; }
    println!("{available}");
}

Official links and next step

✦
YOUR MISSION

Run, test and modify a complete Rust project using fictional data.

Now it's your turn

Discovery workshop

Read, predict, investigate

Predict before revealing. This panel shows prepared results; it does not compile your code. Compiler errors are summarised; exact wording can vary with the compiler version.
Mini experiment

Learning simulation: compare cards and check your predictions. The browser is not compiling Rust or starting a server.

fn main() {
    let total = 3_u16;
    let mut available = total;
    available -= 1;
    println!("{available}");
    let request = 20;
    if request <= available { available -= request; }
    println!("{available}");
    if available < total { available += 1; }
    println!("{available}");
}
Build your answers and check when you are ready.
A moment to understand

What evidence shows a rejected checkout preserved state?

I need a hint

An error can be reported after an improper change; check the data too.

Loading your journey…

How can I tell what I learned?

Use the objectives and challenge below for reflection or a conversation with someone who can help. This is guided self-assessment: it sends no answers, awards no XP and does not automatically verify independence.

In Foundations, change an example, predict results, check a normal case and an error case, and explain your choices. If you need help, identify what to practice again.

Your transfer challenge

Create a catalogue of three fictional items. Test empty input, duplicates and quantity 21. Add a checkout/return sequence and a test that fails if rejection changes state. Explain a limitation and optionally publish with a README; include no personal data.

Keep evidence: prediction, attempt, result, an original change and what you still cannot explain. Seek feedback when possible; if studying alone, return later without copying and compare attempts.

Try again another time

After a break, explain the idea without opening the solution and try a different example. Compare with your first attempt: what can you do independently, and where do you need a hint? You may write, speak or draw; choose a way to check the same idea. Record help received, including AI, and revisit the part you need. There is no universal deadline or extra XP for this record.

Completions and XP record Rullst Academy assessments. An introductory track can help everyday life and prepare further study; alone it does not prove complete mastery or professional readiness. Level indicates depth, not age.

Take it with you

Create a catalogue of three fictional items. Test empty input, duplicates and quantity 21. Add a checkout/return sequence and a test that fails if rejection changes state. Explain a limitation and optionally publish with a README; include no personal data.

RUST II · .rs

Your Rust II workbench

Read, predict and answer here. To actually compile, extract the activity ZIP into a new folder, open a terminal beside Cargo.toml and use the commands below. Rust and your operating system tools must be installed.

cargo check --offline
cargo test --offline
cargo run --offline
My files and GitHub

The editor below saves a draft in this browser and lets you download or publish your .rs. To run it in the project, save the edited file as src/main.rs. The ZIP contains the starter version; prepared results do not change with your edits. Online grading does not verify local execution.

At your own pace

My files and GitHub

Every lesson can become your own record: code, notes or a practice plan. Saving a file to GitHub is optional and does not change your XP.

Student guide

The editor and downloads open when this lesson is available to your account. Check access below or return to the track map.

Checking your access to this lesson…

Rullstpetbot

AI can make mistakes. Check the lesson material.