The core translation
| If your Go instinct says… | Rust asks you to notice… |
|---|---|
x := value | let x = value;; immutable by default unless mut. |
Return (T, error) | Return Result<T, E>; success and failure are one typed value. |
| Pointer or value? | Owner or borrower? T owns; &T reads; &mut T mutates. |
| Nil check | Option<T>; absence must be handled explicitly. |
| Method receiver | self, &self, or &mut self tells ownership/mutation. |
| Package/module | Crate, module, item visibility, and Cargo package layout. |
Read Rust signatures first
fn greet(name: &str) -> String
Read it as: “function greet borrows text named name and returns an owned String.”
fn save(path: &Path, text: &str) -> Result<(), std::io::Error>
Read it as: “borrow a path and text; return either success with no interesting value (), or an I/O error.”
Useful official sources
- The Rust Programming Language for concepts.
- Rust By Example for runnable patterns.
- The Cargo Book for project workflow.
- Tauri docs for app architecture.