Copying, cloning, heap/stack: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=32252bcc07597a79cff3a3602b8465ab
Ownership and Functions: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a9a25c7c5eaa703f9c36667a5696c01f
References: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=91e2dbcfa1976800d96c263fca2f807c
References 2 (Dangling Reference): https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=2b1b0b9ca0abebde874b7e22814df385
Rules of References
- at any given time, you can have either one mutable reference, or any number of immutable references
- references must be valid
Simple Struct Examples + Tuple Structs: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e0d6ae219a88c4adda6e3de8d68c59e6
Structs, Derive, Methods, impl: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a65227e12849b5f81793098758a627cc