diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-08-21 22:09:29 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-08-21 22:09:29 +0200 |
commit | 27514d58573ce1f844af4ea60afa72c7f58f1cd7 (patch) | |
tree | 4b16c31f73cb72435d03d5e105261143f8ca135f /Rust.md | |
parent | 22675cd8dc75d8b8d4b0f818f5b093efbc364802 (diff) |
Diffstat (limited to 'Rust.md')
-rw-r--r-- | Rust.md | 52 |
1 files changed, 15 insertions, 37 deletions
@@ -1,48 +1,26 @@ [[Why it is good to learn rust]] -[[A cool tool that visualizes the borrow checker]] -[[Rust principles]] +[[External Tools]] + +--- +[[Rust Principles]] +[[Rust Data Types]] +[[Rust Control Flow]] +[[Rust Looping]] +[[Rust Ownership]] +[[Rust Collections]] + +--- [[Cargo]] +[[Rand Crate for random numbers]] + [[Items that are always imported by default in Rust are called the prelude]] [[Static class functions are called associated functions]] [[References are also immutable by default]] -[[Random numbers in Rust]] -[[Pattern matching with a match expression]] + [[Shadowing variables]] -[[Integers can overflow if compiled with --release]] -[[Char is a unicode scalar value]] -[[Unlike integers floats do not have an architecture dependent size]] + [[Why is it called destructuring]] -[[Accessing a tuple by index is different from an array]] -[[An empty tuple is called a unit]] -[[Primitive values such as the array are allocated on the stack]] -[[Arrays are useful when you know the length will not change]] -[[Array notation]] [[A scope block is an expression]] [[Adding a semicolon to the end of a line turns it into a statement]] -[[How to return from a function]] [[Statement vs expression]] -[[There is no truthiness]] -[[If is not a statement but an expression]] -[[Returning values from loops]] -[[Loop over an array with for-in]] -[[Undefined behaviour is caught by the compiler]] -[[Variables lives on the stack]] -[[To put data on the heap use a Box]] -[[Cloning a box does a deep copy of the heap data]] -[[Aliasing just means that multiple variables point to the same heap data]] -[[A place is anything that is valid to put on the left-hand side of an assignment]] -[[Ownership]] -[[Dereferencing is to access the data behind a pointer]] -[[Aliasing just means that multiple variables point to the same heap data]] -[[Variables are subject to permissions similar to files on linux]] -[[References temporarily remove permissions]] -[[Creating a reference to a variable is called borrowing]] -[[It is illegal to create a mutable reference while an immutable reference is live]] -[[Data must outlive any references to it]] -[[Move ownership out of the function]] -[[Return a static literal]] -[[Defer borrow checking to runtime with garbage collection]] -[[Provide a slot by the caller]] -[[Clone a reference in a function to modify it]] -[[Shortening the lifetime of borrowed variables before mutating it]] |