From: https://www.reddit.com/r/rust/comments/idwlqu/rust_memory_container_cheatsheet_publish_on_github/g2bsbso/?utm_source=reddit&utm_medium=web2x&context=3
Internal sharing? -[no]--> Allocates? -[no]--> Internal mutability? -[no]--> Ownership? -[no]-----------------------------------> &mut T
\ \ \ `-[yes]----------------------------------> T
\ \ \
\ \ `-[yes]-> Thread-safe? -[no]--> Internal references? -[no]---> Cell<T>
\ \ \ `-[yes]--> RefCell<T>
\ \ \
\ \ `-[yes]-> Internal references? -[no]---> AtomicT
\ \ \ `-[one]--> Mutex<T>
\ \ `--[many]-> RwLock<T>
\ \
\ `-[yes]------------------------------------------------------------------------------------> Box<T>
\
`-[yes]-> Allocates? -[no]-------------------------------------------------------------------------------------> &T
\
`-[yes]-> Thread-safe? -[no]---------------------------------------------------------------> Rc<T>
`-[yes]--------------------------------------------------------------> Arc<T>
Reply
And, I have an interest to several suggestions for a correctness or details. But, the cheat-sheet favor to a newbiews, and the right columns is not a type, yes I know. I'll make an update with include these reddit users suggestions to the rev1 or a later.
From: https://www.reddit.com/r/rust/comments/idwlqu/rust_memory_container_cheatsheet_publish_on_github/g2bsbso/?utm_source=reddit&utm_medium=web2x&context=3
And, I have an interest to several suggestions for a correctness or details. But, the cheat-sheet favor to a newbiews, and the right columns is not a type, yes I know. I'll make an update with include these reddit users suggestions to the rev1 or a later.