Skip to main content

Rc

Ownership in Rust 2. Six ways to share state and how to pick the right one

·9 mins
Move, borrow, clone, Rc, Arc, Cow. Rust gives you six lightsaber forms for ownership. Each one counters a specific threat. Using the wrong form against the wrong opponent is not just inelegant, it is fatal. We map each strategy to the situations where it excels and where it fails catastrophically.