Skip to main content

2 docs tagged with "mutability"

View all tags

Mutable References

We've seen how References and Borrowing allow us to access data without taking ownership. While immutable borrows provide safe, shared read access, sometimes we need to modify the data we're borrowing. This is where mutable references come in. They grant temporary, exclusive write access, and understanding their rules is key to mastering idiomatic and safe Rust.

Variables and Mutability: The Building Blocks of Rust

Welcome to our second series on Rust! Now that you have a solid understanding of the Rust ecosystem and the structure of a Rust program, it's time to dive into the fundamental building blocks of the language. We'll start with one of the most basic concepts in any programming language: variables.