Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux:rust [2021/01/31 11:20] – created kurt.smolderen@empuly.net | linux:rust [2021/02/14 13:05] (current) – kurt.smolderen@empuly.net | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Cargo ===== | ===== Cargo ===== | ||
+ | * '' | ||
* '' | * '' | ||
- | * '' | + | * '' |
+ | ===== Data types ===== | ||
+ | |||
+ | * Scalar types: | ||
+ | * Integer: Internally represented in 2-components notation when signed (-(2< | ||
+ | |||
+ | ^Length^Signed^Unsigned| | ||
+ | |8-bit|i8|u8| | ||
+ | |16-bit|i16|u16| | ||
+ | |32-bit|i32|u32| | ||
+ | |64-bit|i64|u64| | ||
+ | |128-bit|i128|u128| | ||
+ | |arch|isize|usize| | ||
+ | |||
+ | * Floating point: '' | ||
+ | * Boolean: '' | ||
+ | * Character: '' | ||
+ | * Compound types | ||
+ | * Tuple: Fixed size (defined at declaration), | ||
+ | * '' | ||
+ | * Values can be retrieved by either pattern matching: '' | ||
+ | * Array: Fixed size, elements should be of the same type | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * Rust panics on index out of bounds situations | ||
+ | |||
+ | ===== Variables ===== | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | ===== Functions ===== | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | ===== Terminology ===== | ||
+ | |||
+ | * Associated function: function implemented on a type rather than on a particular instance of the type. Similar as a //static method// | ||
+ | * Destructing: | ||
+ | * Expression: instructions that evaluate to a resulting value. No semicolon at end of line! | ||
+ | * Macro: | ||
+ | * Prelude: | ||
+ | * Statement: instructions that do not return a value | ||
+ | * Trait: | ||
+ | |||
+ | ===== Syntax ===== | ||
+ | |||
+ | * ''& | ||
+ | * ''& | ||