Chapter
Chapter 1: Introducing and Installing Rust
Installing rustup on Linux
Testing your installation
Integrated Development Environment
Structure of a Rust project
Creating a binary package using Cargo
Using Cargo to build and run an application
Cleaning your source tree with Cargo
Creating documentation using Cargo
Using Cargo to help with your unit testing
Is there anything Cargo can't do?
How can we tell the compiler that we want x to be an int?
Defining other variable types
Signed and unsigned integers
Defining the variable value before use
What's with the warnings?
Creating a vector with an initial size
Creating a vector via an iterator
Adding and removing from the vector
Manipulating an array or vector via slices
Chapter 3: Input and Output
Functions and methods in Rust
The difference between println! and println
Introduction to the standard library
Controlling the output formatting
Specifying the argument types
Chapter 4: Conditions, Recursion, and Loops
Prematurely terminating a loop
What is the difference between having and not having a semicolon?
Chapter 5: Remember, Remember
Let's start at the beginning
What is meant by the stack?
What about functions with arguments?
Garbage collecting time and ownership
Let's revisit some old code
Chapter 6: Creating Your Own Rust Applications
Project 1 - let's start with some math
Project 2 - some text manipulation
Project 3 – area and volume
Formulae for calculations
Using regular expressions (regex)
Chapter 7: Matching and Structures
Variables, variables everywhere
The structure of a struct
Defining the child structures
Private versus public fields
Using a tuple to define a variable
Tuple structs – the hybrid of two
The single element tuple struct
Back to the unit-like struct
Accessing enumeration members
The two questions you should be asking
Let's really make the function simple
Ignoring a parameter with match
Creating a binding within a match pattern
Let's add an if into the mix
Using match with a compound type
Chapter 8: The Rust Application Lifetime
Ownership – from the beginning
It's all for your own good
The mythical bank account
The lifetime variable - '
Lifetime within an struct
Always consider the scope
Input and output lifetimes
Chapter 9: Introducing Generics, Impl, and Traits
And back to traits we go...
Defining the impl for specific types
Something you may have noticed
Back to the where version
Can we reduce the amount of code further?
Can the default method be overridden?
Let's create a sample test setup
Let's see dynamic dispatch
Chapter 10: Creating Your Own Crate
I can see a problem with this analogy
Creating top-level modules
Beware of double name scopes
Adding unit tests to the library
Let's give our crate a quick run out
Optimizing your use statements
The use-everything approach
The use-me-but-call-me-something-else approach
The use-glob-self approach
Chapter 11: Concurrency in Rust
When is an immutable variable not an immutable variable?
And it's obviously mutable, it has mut in the definition
A beginner's guide to threading in Rust
An easy approach to thinking about how threads work.
Closures aren't all they first appear to be
Closures as function arguments
Closures with explicit lifetimes – a special case
What is the move parameter?
Ownership has its advantages
Problem solved – use Mutex
Why do we put the thread to sleep?
Chapter 12: Now It's Your Turn!
Task 1 – cleaning the code (part 1)
The problems with each option
Task 2 – cleaning the code (part 2)
Task 3 – extending the crate (part 1)
Task 4 – extending the crate (part 2)
Chapter 13: The Standard Library
What is the standard library?
The standard modules (overview)
Primitive types (overview)
Chapter 14: Foreign Function Interfaces
Introducing our simple library
What's the [link(name="")] for?
What's the big deal? That was simple enough!
Let's extend things a bit
What happens if the types don't match?
Can we make things safer?
Accessing global variables
Cleaning up after yourself
Monitoring an external process within an FFI
Targeting synchronous callbacks
Calling Rust from another language