Hey guys, There was a Rust book I was meaning to read, I even recommended it to someone on the Rust discord, but my search-fu is not strong enough to find it any more, and the time has come!
It was a book introducing you to some of the most important and common Rust traits.
That was a good read. Is there anything similar for smart pointers (and when to use them)?
I have written a fairly complex app in Rust and have not needed to use a smart pointer once. (I do use a mut* though, and yes, i acknowledge it's hacky )
The key notion to understand with Rust is the duality of shared access vs.unique access; and the different approaches to get a mutable access out of them:
one gets mutable access out of unique access "for free", that's why &mut references (unique references) are abusingly called mutable references;
but when dealing with shared acces, things get trickier, and one needs to use the appropriate wrapper type with the desired properties / semantics (e.g., unsynchronized and thus single-threaded mutation, or thread-safe mutation through atomics or synchronization primitives).
Great answer thank you! But i think this assumes I'm comfortable already with the uses cases and the problems they solve, (and when indeed these tools are the correct solution to the problem i have)
The above; i would encapsulate under programming competence. Can you suggest any learning material that takes a step back and introduces me to the problem before teaching me how to solve them? (Perhaps 'with entirely too many linked lists' is the ticket! But any other recommendations also appreciated)