❮ Index
❯
TOC: Rust programming
- Introduction to Rust
- Rust resources
- Rust Books
- Crates
- Rust exercises with feedback
- Podcast, newsleter
- Other Rust learning resources
- Rust in other languages
- Articles about Rust
- What is written in Rust?
- Demo None handling
- Install Rust
- Editor and IDE
- Hello World
- Hello World with Cargo
- My little Rust runner
- Rust and comments
- Rust - Hello Foo
- Interpolation
- Printing a string
- Printing a string fixed
- Debugging print
- Rust and print
- Exercise 1
- Variables
- Variables are immutable
- Number in a mutable variable
- Literal strings in variables are immutable
- Literal string in a mutable variable can be replaced
- A literal string cannot be changed
- Really mutable string
- Cannot change variable type
- Redeclare immutable variable - Shadowing
- Redeclare immutable variable and change type - Shadowing
- Convert string to number
- Use libraries
- Random
- STDIN
- Rust - read input from STDIN
- Rust - read STDIN - remove trailing newline (trim, chomp)
- Rust - flush STDOUT - read STDIN
- Get number from STDIN
- Get number from STDIN - same variable
- Get number (i32) in using a function
- Exercise: STDIN rectangle
- Exercis: STDIN calculator
- Solution STDIN rectangle
- Solution: STDIN calculator
- Command line arguments - ARGV
- Conditional operation and boolean values in Rust
- Numbers
- Numerical operations (integers)
- Increment integers
- unfit in i8 - compile time
- unfit in i8 - run time
- rounding float
- Floating point imprecision
- Compare integers
- Compare floating point numbers
- Compare floating point numbers by rounding
- Approximately compare floating point numbers
- Complex numbers
- NaN - Not a Number
- Infinite floating point numbers
- Constants
- Characters
- Strings in Rust
- Create string
- Length of string
- Rust - string slices
- Rust - string characters
- Rust - string ends with
- Rust - string starts with
- Iterate over the characters of a string
- Rust - reverse string
- Concatenation str with str
- Concatenation String with String
- Concatenation String with String (clone)
- Concatenation String with str
- Concatenate strings using format!
- concat
- Split string
- Split string on whitespace
- Append to string with push_str
- Create String from literal string using to_string
- Str and String equality
- String notes
- String replace all
- String replace limited times
- String replace range
- Function to combine two strings
- Ownership and strings
- Slice and change string
- To lower, to upper case
- Compare strings
- Is one string in another string - contains?
- Embed double quotes in string
- Remove leading and trailing whitespace
- Remove extra whitespace from string
- String is alphabetic or alphanumeric
- Loops in Rust
- Tuples in Rust
- struct
- Create simple struct
- Change attributes of a mutable struct
- Struct method to modify fields
- Struct inheritance
- Struct composition
- Struct duplicate
- Printing struct fails
- Print struct (Point)
- Debug struct (Point)
- Print complex struct
- Debug complex struct
- Struct with vector and optional value
- Printing and debug-printing simple struct
- Use a tuple as a struct to represent color
- Add method to tuple-based struct
- Struct with method
- Structs and circural references
- Multiple referene to a struct
- new method with default values for struct
- The new method has no special feature
- Default values
- Default for composite struct
- Compare structs for Equality
- Compare structs for Equality - manual implementation
- Compare structs for partial equality - PartialEq
- Compare structs for ordering (sorting) - Ord
- Compare structs for partial ordering (sorting) - PartialOrd
- Manually implement ordering
- Arrays in Rust
- Vectors in Rust
- Fixed vector of numbers
- Iterate over elements of vector using for-loop
- Mutable vector of numbers, append (push) values
- Mutable empty vector for numbers (push)
- Mutable empty vector for strings
- Mutable empty vector with type definition
- Mutable vector of strings
- Count words
- Vector extend (combining two vectors)
- Split string into vector
- Sort vector of numbers
- Exercise: Median
- Exercise: ROT13
- Chars to string
- Vector of tuples
- Vector of structs
- Vector of structs - change value
- Join elements of vector into a string
- Join vector of integers
- Maximum value of a vector
- Longest or shortest string in a vector
- Change vector using map
- Update values in vector of structs using map
- map is lazy
- filter numbers
- filter numbers iter into
- filter numbers by named function
- filter string
- Two references to the same vector
- Filter vector of structs (cloning)
- Convert vector of structs to vector of references
- Filter vector of structs without copy
- Accessing the last element of a vector
- Insert element in vector
- Vector with optional values - None or out of range?
- Vector with optional values
- Vector length and capacity
- References to numbers
- Queue
- Hashes in Rust
- Create empty HashMap, insert key-value pairs
- Create immutable hash with data
- Check if hash contains key (key exists)
- Get value from hash
- Iterate over keys of a hash
- Iterate over key-value pairs in a Hash
- Rust hash update value
- Rust update values in a hash - count words
- Remove element from hash
- Accessing values
- Split string create hash
- Create hash from key-value pairs after split
- Read key-value pairs from file
- Sort vector of hashes
- Mapping structs based on more than one key
- Mapping structs based on more than one key from a vector
- Create hash from vector of tuple pairs
- Enum
- Files
- Rust - write to file
- Rust - read content of a file as a string
- Rust - read file line-by-line
- Rust - read file line-by-line with row number (enumerate)
- Rust - counter
- Rust list content of directory
- Rust list directory content recursively (tree)
- Count digits in file
- Makedir
- Makedirs
- Get the temporary directory
- Create temporary directory
- Current working directory
- Change directory
- open file error handling
- Appand to file
- Show size of file
- du - disk usage
- get file extension
- parent directory
- directory ancestors (parent directories)
- directory ancestor (n level)
- join pathes
- basename
- Path
- Rust types
- Functions
- Rust main function
- Rust hello world function
- Rust function with parameter (&str)
- Rust function return value (integer i32)
- Return the last expression (no return)
- Return a string
- Rust recursive functions: factorial
- Rust recursive functions: Fibonacci
- Make function argument mutable inside the function
- Cannot decalre the same function twice
- Pass by reference to change external variable - Increment in a function
- Count digits using functions
- Function returning multiple values
- Function accepting multiple types (e.g. any type of numbers)
- Function that can accept any number (any integer or any float)
- Exercise rectangle functions
- Variable ownership in Rust
- Stack and Heap
- Integers are copies
- Passing integers to functions and returning integer
- Mutable integers are copies
- Immutable integers are copies
- Pass integer to function return changed value
- Pass mutable reference of integer to function
- Literal string
- Literal string in mutable variable
- Passing literal string to function
- Mutable string in immutable variable
- Mutable string
- Move strings
- Move mutable string
- Rust clone a String
- Rust ownership - borrow String
- Rust ownership string in function
- Rust ownership borrow string in function
- Rust function to change string
- Rust function to change integer (i32)
- Lifetime annotation
- Change vector of structs
- Error handling in Rust
- Runtime error (panic) noticed during compilation.
- Divide by zero panick in function
- Return error on failure
- Divide by zero runtime panic
- Divide by zero return error
- factorial function, runtime panic
- factorial create panic
- Out of bound for vectors
- Out of bound for arrays
- Open files
- Error handling on the command line
- Number guessing
- Date and Time
- DateTime with Chrono
- CSV
- Handlebars
- liquid templating
- Install
- Liquid Hello World
- Liquid Hello World with variable
- Liquid Hello World read template from file
- Liquid flow control: if - else
- Liquid flow control: else if written as elsif
- Liquid flow control: case/when
- Liquid object
- Liquid for loop passing a vector or an array
- Liquid for loop with if conditions
- Liquid filters on numbers: plus, minus
- Liquid filters on strings: upcase, downcase, capitalize
- Liquid filters: first, last
- Liquid
- Liquid include
- Liquid assign to variable in template
- Liquid include header and footer
- Liquid layout (include and capture)
- Liquid with struct
- Liquid filter reverse array
- Liquid for loop: limit, offset, reversed
- Liquid comma between every two elements (forloop.last)
- Liquid: create your own filter: reverse a string
- Liquid: create your own filter: commafy
- Liquid: length of string, size of vector
- Packages and modules
- Crates
- Testing
- Threads in Rust
- Threads in Rust
- First example with threads
- Threads with messages
- Two threads sending messages
- Testing speed improvements with threads
- Save many files
- Rust threads read-only access to shared variables
- Pass reference of read-only vector to thread
- Pass reference of read-only vector to thread improved
- Pass and return reference (return ownership)
- Thread scope
- chdir in threads
- map with threads
- map with threads with Mutex
- Counter in a loop in the same process and thread
- Counter with threads (shared variable?)
- Counter with message passing
- Regex
- Sets
- Command line Interface with clap
- JSON
- YAML
- TOML
- Iterators
- Iterate over vector of numbers
- Alternatively, we could create an iterator using the iter method.
- Create a simple iterator to count up to a number
- Create a simple iterator to count boundless
- Iterate over files in current directory
- Iterate over files in current directory calling next
- Iterator to walk directory tree
- Count number of elements of an iterator
- Advanced Functions
- image
- http
- Logging
- Execute and run external commands
- Macros
- What is a macro
- todo!
- Declarative macros
- Hello World macro
- Macro with parameter to say hello
- Macro with optional parameter to say hello
- Macro with many parameters to say hello
- Macro to create a HashMap to be a counter
- HTML to string macro
- Num traits
- Procedural macros
- Macro accepting a single string
- Accept list of values as a plain string in a macro
- Compile random number in the code using macro
- SQLx - compile-time SQL queries
- Macro ok! to replace unwrap
- Error logging
- egui
- SQLite
- Other
- Variable shadowing
- String formatting
- Factorial functions returning Result
- Split function into files
- Variable Scope in Rust
- Declare empty variable and assign to it later
- Declare empty variable - requires type
- SystemTime now
- Exit
- Define multiple variables
- wc
- copy vs clone
- Type alias
- Solution: Age limit
- Multi-counter in manually handled CSV file
- Get path to current executable
- cache dependencies with sccache
- Commafy
- Commafys
- Use statements
- Take version number from Cargo.toml
- Ansi colors
- What I learned from learning Rust
- Temperature converter
- Check slides
- Expressions vs statements
- Send email via SendGrid
- Compare memory address (pointer)
- Equality of Some - values
- Fork
- sysinfo - Which Operating System are we running on?
- Operating system information with os_info
- Parse string to Rust expression using syn
- Parse HTML
- Fix URL parameter