Overview

Map Rust habits to the Musi Book without repeating every construct example.

Rust readers already look for ownership, enums, traits, Result, modules, pattern matching, and explicit unsafe. Musi shares the habit of making branches and contracts visible, but has its own split: data for variants, records for fields, classes/instances for behavior, effects for requested outside work, and foreign declarations for native edges.

Use this guide as a translation journal for Rust code. Start with the familiar habit, then ask which Musi construct owns the same promise. A page is successful when it tells you which old instinct to keep and which old shortcut to drop.

Start from the habit that hurts

Habits that still help

  • Keep the Rust habit of asking which type carries the invariant.
  • Drop syntax expectations around impl, lifetimes, and match punctuation; read the Musi contract instead.
  • Keep examples tied to ordinary work: receipts, routes, files, animals, people, rooms, and services.

First false friend

Musi class is closest to a Rust trait plus law text; instances play the role of implementations for behavior. If you need a person, car, invoice, or package, start with records or data. If you need any type that can compare, show, encode, or step, use a class with instances.

When to switch to the Musi Book

Stay in this guide while a Rust habit is getting in the way. Switch to Values and let, Records, Patterns, Generics, Classes, and Effects when you need the source-of-truth rule.