External Publication
Visit Post

InteriorAssign trait { a := b }

Rust Internals [Unofficial] May 10, 2026
Source

steffahn:

*data.ref_cell.borrow_mut() = Some(new_value);

A better example might be Cell, since it doesn't let you do that. I imagine this feature coming into play whenever you have a type that doesn't want to hand out references to its interior but still wants to allow you to mutate it. C# properties are a similar thing (and maybe something closer to those would be a better idea, idk).

Discussion in the ATmosphere

Loading comments...