A FEW SIMPLE STEPS
Get started
- Create a note and choose Rust or .rs.
- Paste the function or source fragment with its relevant types.
- Edit the source, add explanatory comments, and compare revisions if needed.
- Download the .rs note and check it in your own Rust crate.
Open editor takes you to the draft on this page. Paste or open a source file, or choose Try this example. Save to notebook keeps a named copy with your notes. Your workspace style stays unchanged.
Keep ownership assumptions with the source
Rust examples are easier to reuse when their types and borrowing assumptions are visible. Keep the function signature and a note about expected inputs alongside the expression you want to remember.
Save a reusable selection as a custom snippet or tag the note for the project it belongs to. Use comparison panes when a change to a signature or return type deserves a careful review.
Use Cargo and rustc for the final checks
The editor does not invoke rustc, Cargo, the borrow checker, or rustfmt. Syntax highlighting and the notebook’s formatting tools do not establish that a Rust program compiles.
Copy the example into your crate to check lifetimes, traits, dependency versions, and tests. Keep related Cargo.toml text in a TOML note when that context helps explain the example.
A few questions
Does the Rust editor check borrowing or run Cargo?
No. It edits source text. Use rustc, Cargo, and your project’s tests to validate Rust code.