1. Rust
  2. Self Introduction
    1. Who am I?
    2. Who are you?
  3. Introduction to Rust
    1. Why Rust?
    2. Why Rust - Performance
    3. What is written in Rust?
    4. Why Rust - Reliability
    5. Why Rust - Productivity
    6. Major features of Rust
    7. Rust Jobs
    8. Memory allocation
    9. Rust Books
    10. Crates (3rd party libraries)
    11. Rust exercises with feedback
    12. Podcast, newsleter
    13. Other Rust learning resources
    14. Rust in other languages
    15. Articles about Rust
    16. Rust community
    17. Demo None handling
    18. Demo Option to handle None
    19. Demo None handling with Option
    20. Error handling
    21. Demo error handling with Result
    22. Demo error handling with Result and question mark
    23. Error handling
  4. Hello World
    1. Install Rust
    2. Editor and IDE
    3. Hello World
    4. Hello World with Cargo
    5. Cargo build
    6. Run in release mode
    7. Use of macros with parentheses, square brackets, or curly braces
    8. Rust and comments
    9. Rust - Hello Foo
    10. Interpolation
    11. Printing a variable
    12. Printing a variable fixed
    13. Debugging print
    14. Rust and print
    15. Exercise: Hello World
  5. Variables
    1. Variables are immutable
    2. Number in a mutable variable
    3. Literal strings in variables are immutable
    4. Literal string in a mutable variable can be replaced
    5. A really mutable string
    6. A literal string cannot be changed
    7. Cannot change the type of a variable
    8. Redeclare immutable variable - Shadowing
    9. Redeclare immutable variable and change type - Shadowing
  6. Convert string to number
    1. Convert string to (integer) number - parse, turbofish
    2. Convert string to number that ends with newline
    3. Convert string to number after removing whitespaces
    4. Convert string to float
  7. Command line arguments - ARGS intro
    1. Command line arguments - args
    2. Exercise: Rectangle ARGS
    3. Exercise: Circle ARGS
    4. Exercise: basic math operations
    5. Solution: Rectangle ARGS
    6. Solution: Circle ARGS
    7. Solution: basic math operations
  8. Development tools
    1. Code formatting
    2. Clippy
    3. Extreme Clippy
    4. Cargo audit
    5. Cargo watch
    6. Pre-commit hook
    7. Continuous Integration
  9. Use libraries
    1. Using the Standard library
    2. Using a single value from the Standard library
    3. Use (import) a name higher up in the hierarchy
    4. Using a library with an alias
    5. TODO: Crate library and use local library
  10. Rust types
    1. Rust Types
    2. Rust infers the type of variables
    3. Showing type
    4. Print type of variable
  11. Numbers
    1. Rust numerical types
    2. Numerical operations on integers
    3. Divide integers and get float
    4. Rust type mismatch in numerical operation
    5. Increment integers - augmented assignment
    6. unfit in i8 - compile time
    7. unfit in i8 - run time - overflow
    8. How to find code that might overflow / underflow?
    9. Handle overflow and underflow - saturating
    10. Handle overflow and underflow - checked
    11. Handle overflow and underflow - overflowing
    12. Handle overflow and underflow - carrying
    13. Handle overflow and underflow - strict
    14. Compare integers
    15. Compare integers in and if-statement
    16. Exponent - power
    17. Exponent protecting against overflow - checked_pow, saturating_pow
    18. Square root (sqrt)
    19. Square root of integer numbers
    20. Floating point imprecision
    21. Compare floating point numbers
    22. rounding float
    23. Compare floating point numbers by rounding
    24. Approximately compare floating point numbers
    25. NaN - Not a Number
    26. Infinite floating point numbers
    27. Complex numbers
    28. Functions and test adding numbers
    29. Exercise: Rectangle ARGS with protection
    30. Exercise: Rectangle add tests
    31. Exercise: Circle add tests
    32. Solution: Rectangle ARGS with protection
  12. Constants
    1. Rust constants
    2. Constant shadowing
  13. Characters
    1. Single character
  14. Random
    1. Using 3rd party libraries
    2. Random module
  15. STDIN
    1. Rust - read input from STDIN
    2. Rust - read STDIN - remove trailing newline (trim, chomp)
    3. Rust - flush STDOUT - read STDIN
    4. Get number from STDIN
    5. Get number from STDIN - same variable
    6. Get number (i32) in using a function
    7. Exercise: STDIN rectangle
    8. Exercise: STDIN circle
    9. Exercise: STDIN calculator
    10. Solution STDIN rectangle
    11. Solution: STDIN calculator
  16. Loops in Rust
    1. Three types of loops in Rust
    2. While loop in Rust
    3. Rust: loop with break
    4. break returns value from loop
    5. for loop in Rust
  17. Conditional operation and boolean values in Rust
    1. Conditional: if
    2. Conditional: if - else
    3. Conditional: else - if
    4. Avoid the comparison chain using match
    5. Rust: boolean values true and false
    6. Assign result of conditional to variable
    7. Rust: other types don't have true/false values
    8. Toggle
    9. if-else returns a value
    10. Conditional (Ternary) operator
    11. match
    12. match all the numbers of an integer type
    13. match all the numbers of a float type
    14. match with conditions
    15. Exercise: one-dimensional space-fight
    16. Solution: one-dimensional space-fight
  18. Arrays in Rust
    1. Arrays in Rust
    2. Rust array of numbers, length of array
    3. Array of strings - access element by index
    4. Array of structs
    5. Array iterate on elements
    6. Rust array iterate over idices
    7. Rust array iterate indices and elements with enumerate
    8. Rust arrays are not mutable
    9. Make the Rust array mutable
    10. Creating an array with the same value
    11. Exercise: Count digits
    12. Solution: Count digits
  19. Option
    1. The Option enum
    2. Create Option
    3. Checked rectangle
    4. Get language function returning Option
  20. Strings in Rust
    1. Create a String
    2. Create empty string and grow it using push and push_str
    3. Length of string
    4. Capacity of string
    5. Strings and memory allocation
    6. Rust - string ends with
    7. Rust - string starts with
    8. To lower, to upper case
    9. Accessing characters in a string
    10. Rust - string slices
    11. Rust - string characters
    12. Iterate over the characters of a string
    13. Rust - reverse string
    14. Concatenation str with str
    15. Concatenation String with String
    16. Concatenation String with String (clone)
    17. Concatenation String with str
    18. Concatenate strings using format!
    19. concat
    20. Split string
    21. Split string on whitespace
    22. Split on newlines - use lines
    23. Append to string with push_str
    24. Create String from literal string using to_string
    25. Str and String equality
    26. String notes
    27. String replace all
    28. String replace limited times
    29. String replace range
    30. Function to combine two strings
    31. Ownership and strings
    32. Slice and change string
    33. Compare strings
    34. Is one string in another string - contains?
    35. Embed double quotes in string
    36. Remove leading and trailing whitespace
    37. Remove extra whitespace from string
    38. String is alphabetic or alphanumeric
    39. Compare memory address (pointer)
    40. Exercise: Count digits from string
    41. Exercise: concatenate strings
    42. Exercise: is it a palindrome?
    43. Exercise: is it an anagram?
    44. Exercise: Get nth double character
    45. Exercise: get first word
    46. Solution: Count digits from string
  21. Command line arguments - ARGS
    1. Command line arguments - print all args
    2. Command line program with a single file parameter
    3. Exercise: calucaltor args
    4. Solution: calucaltor args
    5. Default value on the command line
    6. Default path - return PathBuf
  22. Tuples in Rust
    1. Rust tuple - fixed-sizes, mixed, ordered collection
    2. Define the types in the tuple
    3. Change tuple (mutable)
    4. Create tuple with types, but without values
    5. Destructuring tuple
    6. The empty tuple is called the unit
    7. One element tuple
    8. Enumerate over vector uses tuples
    9. Return multiple values from a function
  23. struct
    1. Create simple struct
    2. Change attributes of a mutable struct
    3. Implement a method for a struct
    4. Struct method to modify fields
    5. Struct inheritance
    6. Struct composition: Circle
    7. Struct composition: Line
    8. Struct with vector of structs - Polygon
    9. Printing struct fails
    10. Print struct - implement Display
    11. Debug struct - implement Debug
    12. Derive Debug for struct
    13. Struct with vector and optional value
    14. Printing and debug-printing simple struct
    15. Use a tuple as a struct to represent color
    16. Add method to tuple-based struct
    17. Struct with method
    18. Structs and circural references
    19. new method with default values for struct
    20. The new method has no special feature
    21. Default values
    22. Empty string and zero as default values
    23. Derived Default values
    24. Default for composite struct
    25. Compare structs for Equality
    26. Compare structs for Equality - manual implementation
    27. Compare structs for partial equality - PartialEq
    28. Compare structs for ordering (sorting) - Ord
    29. Compare structs for partial ordering (sorting) - PartialOrd
    30. Manually implement ordering
    31. Copy attributes from struct instance
    32. Drop - destructor
    33. Exercise - struct for contact info
    34. Solution - struct for contact info
    35. Read from a file and return a struct
    36. Converting between types: The From and Into traits
    37. From and Into for String and &str
    38. Implementing the From trait for 2D and 3D point structs
    39. Other: Struct and type alias - Polygon
    40. Other: Struct duplicate
    41. Other: Multiple referene to a struct
    42. Other: Print struct (Point)
    43. Other: Debug struct (Point)
  24. Vectors in Rust
    1. Fixed vector of numbers
    2. Iterate over elements of vector using for-loop
    3. Mutable vector of numbers, append (push) values
    4. Mutable empty vector for numbers (push)
    5. Mutable empty vector for strings
    6. Mutable empty vector with type definition
    7. Mutable vector of strings
    8. Remove the last element using pop, reduce capacity
    9. Stack and the capacity of a vector
    10. Extend vectors of numbers (combining two vectors)
    11. Extend vector of Strings (combining two vectors)
    12. Append vector of Strings (moving over elements)
    13. Split string into iterator
    14. Split string into vector
    15. Sort vector of numbers
    16. Sort vector of strings using sorting condition
    17. Exercise: Median
    18. Exercise: ROT13
    19. Solution: Median
    20. Solution: ROT13
    21. Convert vector of chars to String
    22. Vector of tuples
    23. Vector of structs
    24. Vector of structs - change value
    25. Join elements of vector into a string
    26. Join vector of integers
    27. Maximum value of a vector
    28. Longest or shortest string in a vector
    29. Change vector of numbers using map
    30. Update values in vector of structs using map
    31. map is lazy
    32. map is lazy that can cause problems
    33. filter numbers
    34. filter numbers iter into
    35. filter numbers by named function
    36. filter string
    37. Two references to the same vector
    38. Filter vector of structs (cloning)
    39. Convert vector of structs to vector of references
    40. Filter vector of structs without copy
    41. Combine filter and map into filter_map
    42. Accessing the last element of a vector
    43. Insert element in vector
    44. Vector with optional values - None or out of range?
    45. Vector with optional values
    46. Vector length and capacity
    47. References to numbers
    48. Queue
    49. Iterate over both index and value of a vector (enumerate)
    50. Create vector of strings from array of str using from_iter
    51. Memory allocation of vector of numbers
    52. Memory allocation of vector of strings
    53. Exercise: Count words using two vectors
    54. Solution: Count words using two vectors
  25. HashMap in Rust
    1. What is a HashMap?
    2. Create empty HashMap, insert key-value pairs
    3. Create immutable hash with data
    4. Check if hash contains key (key exists)
    5. Get value from hash
    6. Iterate over keys of a hash
    7. Iterate over key-value pairs in a Hash
    8. Rust hash update value
    9. Rust update values in a hash - count words
    10. Remove element from hash
    11. Accessing values
    12. Split string create hash
    13. Create hash from key-value pairs after split
    14. Read key-value pairs from file
    15. Sort vector of hashes
    16. Mapping structs based on more than one key
    17. Mapping structs based on more than one key from a vector
    18. Create hash from vector of tuple pairs
    19. Hash of vectors in Rust
    20. Add items to a hash of vectors using a function
    21. Integers as keys of a HashMap
    22. Tuples as keys of a HashMap
    23. Structs as keys of a HashMap
    24. Merge HashMaps (extend)
    25. Merge two HashMaps adding the values
    26. Merge two HashMaps adding the values implemented as a function
    27. Merge two HashMaps adding the values in a function
    28. Convert HashMap to vector of tuples and sort by key or by value
    29. Other: Add method to HashMap that sums the values
  26. Enums
    1. Why enums
    2. Enum to represent exit status
    3. Enum to represent exit code
    4. Enumeration of the 7 days of the week
    5. Enumeration with non-exhaustive patterns
    6. Enumeration and manual comparision
    7. Enumeration and order
    8. Enumeration colors - functions and String
    9. Enumeration colors - functions and str
    10. Enumeration colors - with method
    11. Enumeration colors - with constructor
    12. Enumerate without PartialEq using match
    13. Struct using enum
    14. Exercise: enum for programming languages
    15. Solution: enum for programming languages
    16. The Result enum
    17. Iterate over the variants of an enum
  27. Files
    1. Rust - write to file
    2. Rust - read content of a file as a string
    3. Rust - read file line-by-line
    4. Rust - read file line-by-line with row number (enumerate)
    5. Rust - counter
    6. Rust list content of directory
    7. Rust list directory content recursively (tree)
    8. Makedir
    9. Makedirs
    10. Get the temporary directory
    11. Create temporary directory
    12. Current working directory
    13. Change directory
    14. Append to file
    15. Show size of file
    16. du - disk usage
    17. Error handling in file operations
    18. Exercise count digits in file
    19. Exercise - wc (word count)
    20. Exercise - simple grep
    21. Exercise - du (disk usage)
    22. Solution: count digits in file
  28. Path
    1. Return vector of Path or PathBuf
    2. Convert the PathBuf to String to compare
    3. get file extension
    4. file extension
    5. parent directory
    6. directory ancestors (parent directories)
    7. directory ancestor (n level)
    8. join pathes
    9. basename (file_name)
    10. Relative and absolute path
    11. List content of a directory - listdir
    12. List dir recursively
  29. Functions
    1. Rust main function
    2. Rust hello world function
    3. Rust function with parameter (&str)
    4. Rust functions return the unit by default
    5. Rust function return value (integer i32)
    6. Return the last expression (no return)
    7. Return a string
    8. Rust recursive functions: factorial
    9. Rust recursive functions: Fibonacci
    10. Make function argument mutable inside the function
    11. Cannot decalre the same function twice
    12. Pass by reference to change external variable - Increment in a function
    13. Count digits using functions
    14. Function returning multiple values
    15. Function accepting multiple types (e.g. any type of numbers)
    16. Function that can accept any number (any integer or any float)
    17. Exercise rectangle functions
    18. Exercise: is prime?
    19. Scoped functions
  30. Variable ownership in Rust
    1. Stack and Heap
    2. Integers are copies
    3. Passing integers to functions and returning integer
    4. Mutable integers are copies
    5. Immutable integers are copies
    6. Pass integer to function return changed value
    7. Pass mutable reference of integer to function
    8. Literal string
    9. Literal string in mutable variable
    10. Passing literal string to function
    11. Mutable string in immutable variable
    12. Mutable string
    13. Move strings
    14. Move mutable string
    15. Rust clone a String
    16. Rust ownership - borrow String
    17. Pass ownership of String to function
    18. Borrow String when passing to a function
    19. Borrow &str when passing String to a function
    20. Rust function to change string
    21. Rust function to change integer (i32)
    22. Lifetime annotation
    23. Change vector of structs
    24. Try to return &str from function
    25. Exercise: concatenate file content
    26. Pass vector to function
  31. Date and Time
    1. Measure elapsed time
    2. Duration
    3. Instant sleep Duration
    4. Handle time (using the time crate)
  32. Modules
    1. Function in the main.rs file
    2. Module defined in the main.rs file
    3. Module in other file
    4. Modules and enums
    5. Modules and structs
  33. Crates
    1. Create a crate
  34. Sets
    1. HashSet
    2. Basic Set operations in Rust
    3. Union and bitor
    4. Difference
  35. Lifetime
    1. Lifetime elision rules
    2. Function receiving and returning one reference
    3. Function receiving two and returning one reference
    4. Exercise: longest string
    5. Exercise: lifetime
  36. Iterators
    1. Iterate over vector of numbers
    2. Alternatively, we could create an iterator using the iter method
    3. Count number of elements of an iterator
    4. Iterator: all the elements
    5. Iteration moves values
    6. Iterator that restarts
    7. Circular Iterator that restarts
    8. Create a simple iterator to count up to a number
    9. Create a simple iterator to count boundless
    10. Iterate over files in current directory
    11. Iterate over files in current directory calling next
    12. Iterator to walk directory tree
    13. Mutable iterator
    14. Take the first N elements of an iterator
    15. Skip the first N elements of an iterator
    16. Skip and take from an iterator
    17. Counting the number of iterations - count vs collect-len
    18. Exercise: Iterator for the Fibonacci series
    19. Solution: Iterator for the Fibonacci series
    20. Iter strings
    21. Non-circular iterators
  37. Advanced Functions
    1. Pass function as argument - hello world
    2. Pass function with parameter as an argument
    3. Dispatch table - Calculator
    4. Dispatch table - Calculator
    5. Generic functions to add numbers
    6. Generic functions to add numbers using where clause
    7. Exercise: generic function
    8. Exercise: call the add function for two points
    9. Exercise: Implement function to repeate a string
    10. Solution: Implement function to repeate a string
    11. Solution: call the add function for two points
  38. DateTime with Chrono
    1. Chrono now
    2. Elapsed time
    3. Date and time arithmetic
    4. Compare chrono dates
    5. Format DateTime
    6. Parse string to datetime
  39. Testing
    1. Testing a library crate
    2. Test coverage report with tarpaulin
    3. Test a function in a crate
    4. Show STDOUT and STDERR during testing
    5. Testing with temporary directory passed as an environment variable (test in a single thread RUST_TEST_THREADS)
    6. Testing with temorary directory passed in a thread-local variable
    7. Testing crates
    8. Parametrization of tests
    9. Rust testing setup and teardown fixtures
  40. TOML
    1. Reading a TOML file
    2. Parsing TOML values
  41. Execute and run external commands
    1. The external program we'll run
    2. Run external programs
    3. Run external program combining parameters
    4. Run a command provided as a string
    5. Run external command in another directory