Reference
This is a curated, step-through model of safe Rust String examples, not a Rust compiler or a memory debugger. Diagrams show ownership and access, not actual memory addresses. They do not execute rejected programs. Challenge answers are practice, not a measure of mastery.
These examples omit reborrowing, interior mutability, Copy types and advanced lifetime inference. A moved String need not copy its heap contents. A borrow can stop being needed at its last use; it does not always last to the closing brace.