finished all but the main example
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
# Some background information
|
||||
|
||||
> **Relevant for:**
|
||||
>
|
||||
> - High level introduction to concurrency in Rust
|
||||
> - Knowing what Rust provides and not when working with async
|
||||
> - Understanding why we need runtimes
|
||||
> - Knowing that Rust has `Futures 1.0` and `Futures 3.0`, and how to deal with them
|
||||
> - Getting pointers to further reading on concurrency in general
|
||||
|
||||
Before we start implementing our `Futures` , we'll go through some background
|
||||
information that will help demystify some of the concepts we encounter.
|
||||
|
||||
@@ -91,12 +99,7 @@ Now learning these concepts by studying futures is making it much harder than
|
||||
it needs to be, so go on and read these chapters. I'll be right here when
|
||||
you're back.
|
||||
|
||||
However, if you feel that you have the basics covered, then go right on. The concepts we need to
|
||||
learn are:
|
||||
|
||||
1. Trait Objects and fat pointers
|
||||
2. Generators/stackless coroutines
|
||||
3. Pinning, what it is and why we need it
|
||||
However, if you feel that you have the basics covered, then go right on.
|
||||
|
||||
Let's get moving!
|
||||
|
||||
|
||||
@@ -8,58 +8,54 @@
|
||||
|
||||
## Trait objects and dynamic dispatch
|
||||
|
||||
The single most confusing topic we encounter when implementing our own `Futures`
|
||||
One of the most confusing topic we encounter when implementing our own `Futures`
|
||||
is how we implement a `Waker` . Creating a `Waker` involves creating a `vtable`
|
||||
which allows using dynamic dispatch to call methods on a _type erased_ trait
|
||||
which allows us to use dynamic dispatch to call methods on a _type erased_ trait
|
||||
object we construct our selves.
|
||||
|
||||
If you want to know more about dynamic dispatch in Rust I can recommend this article:
|
||||
|
||||
https://alschwalm.com/blog/static/2017/03/07/exploring-dynamic-dispatch-in-rust/
|
||||
>If you want to know more about dynamic dispatch in Rust I can recommend an article written by Adam Schwalm called [Exploring Dynamic Dispatch in Rust](https://alschwalm.com/blog/static/2017/03/07/exploring-dynamic-dispatch-in-rust/).
|
||||
|
||||
Let's explain this a bit more in detail.
|
||||
|
||||
## Fat pointers in Rust
|
||||
|
||||
Let's take a look at the size of some different pointer types in Rust. If we
|
||||
run the following code:
|
||||
run the following code. _(You'll have to press "play" to see the output)_:
|
||||
|
||||
``` rust
|
||||
# use std::mem::size_of;
|
||||
trait SomeTrait { }
|
||||
|
||||
fn main() {
|
||||
println!("Size of Box<i32>: {}", size_of::<Box<i32>>());
|
||||
println!("Size of &i32: {}", size_of::<&i32>());
|
||||
println!("Size of &Box<i32>: {}", size_of::<&Box<i32>>());
|
||||
println!("Size of Box<Trait>: {}", size_of::<Box<SomeTrait>>());
|
||||
println!("Size of &dyn Trait: {}", size_of::<&dyn SomeTrait>());
|
||||
println!("Size of &[i32]: {}", size_of::<&[i32]>());
|
||||
println!("Size of &[&dyn Trait]: {}", size_of::<&[&dyn SomeTrait]>());
|
||||
println!("Size of [i32; 10]: {}", size_of::<[i32; 10]>());
|
||||
println!("Size of [&dyn Trait; 10]: {}", size_of::<[&dyn SomeTrait; 10]>());
|
||||
println!("======== The size of different pointers in Rust: ========");
|
||||
println!("&dyn Trait:-----{}", size_of::<&dyn SomeTrait>());
|
||||
println!("&[&dyn Trait]:--{}", size_of::<&[&dyn SomeTrait]>());
|
||||
println!("Box<Trait>:-----{}", size_of::<Box<SomeTrait>>());
|
||||
println!("&i32:-----------{}", size_of::<&i32>());
|
||||
println!("&[i32]:---------{}", size_of::<&[i32]>());
|
||||
println!("Box<i32>:-------{}", size_of::<Box<i32>>());
|
||||
println!("&Box<i32>:------{}", size_of::<&Box<i32>>());
|
||||
println!("[&dyn Trait;4]:-{}", size_of::<[&dyn SomeTrait; 4]>());
|
||||
println!("[i32;4]:--------{}", size_of::<[i32; 4]>());
|
||||
}
|
||||
```
|
||||
|
||||
As you see from the output after running this, the sizes of the references varies.
|
||||
Most are 8 bytes (which is a pointer size on 64 bit systems), but some are 16
|
||||
Many are 8 bytes (which is a pointer size on 64 bit systems), but some are 16
|
||||
bytes.
|
||||
|
||||
The 16 byte sized pointers are called "fat pointers" since they carry more extra
|
||||
information.
|
||||
|
||||
**In the case of `&[i32]` :**
|
||||
|
||||
* The first 8 bytes is the actual pointer to the first element in the array
|
||||
|
||||
(or part of an array the slice refers to)
|
||||
**Example `&[i32]` :**
|
||||
|
||||
* The first 8 bytes is the actual pointer to the first element in the array (or part of an array the slice refers to)
|
||||
* The second 8 bytes is the length of the slice.
|
||||
|
||||
The one we'll concern ourselves about is the references to traits, or
|
||||
_trait objects_ as they're called in Rust.
|
||||
**Example `&dyn SomeTrait`:**
|
||||
|
||||
`&dyn SomeTrait` is an example of a _trait object_
|
||||
This is the type of fat pointer we'll concern ourselves about going forward.
|
||||
`&dyn SomeTrait` is a reference to a trait, or what Rust calls _trait objects_.
|
||||
|
||||
The layout for a pointer to a _trait object_ looks like this:
|
||||
|
||||
@@ -67,17 +63,19 @@ _trait objects_ as they're called in Rust.
|
||||
* The second 8 bytes points to the `vtable` for the trait object
|
||||
|
||||
The reason for this is to allow us to refer to an object we know nothing about
|
||||
except that it implements the methods defined by our trait. To allow this we use
|
||||
dynamic dispatch.
|
||||
except that it implements the methods defined by our trait. To allow accomplish this we use _dynamic dispatch_.
|
||||
|
||||
Let's explain this in code instead of words by implementing our own trait
|
||||
object from these parts:
|
||||
|
||||
``` rust
|
||||
>This is an example of _editable_ code. You can change everything in the example
|
||||
and try to run it. If you want to go back, press the undo symbol. Keep an eye
|
||||
out for these as we go forward. Many examples will be editable.
|
||||
```rust, editable
|
||||
// A reference to a trait object is a fat pointer: (data_ptr, vtable_ptr)
|
||||
trait Test {
|
||||
fn add(&self) -> i32;
|
||||
fn sub(&self) -> i32;
|
||||
fn add(&self) -> i32;
|
||||
fn sub(&self) -> i32;
|
||||
fn mul(&self) -> i32;
|
||||
}
|
||||
|
||||
@@ -117,10 +115,10 @@ fn main() {
|
||||
0, // pointer to `Drop` (which we're not implementing here)
|
||||
6, // lenght of vtable
|
||||
8, // alignment
|
||||
|
||||
// we need to make sure we add these in the same order as defined in the Trait.
|
||||
// Try changing the order of add and sub and see what happens.
|
||||
add as usize, // function pointer
|
||||
sub as usize, // function pointer
|
||||
add as usize, // function pointer - try changing the order of `add`
|
||||
sub as usize, // function pointer - and `sub` to see what happens
|
||||
mul as usize, // function pointer
|
||||
];
|
||||
|
||||
@@ -135,68 +133,6 @@ fn main() {
|
||||
|
||||
```
|
||||
|
||||
If you run this code by pressing the "play" button at the top you'll se it
|
||||
outputs just what we expect.
|
||||
|
||||
This code example is editable so you can change it
|
||||
and run it to see what happens.
|
||||
|
||||
The reason we go through this will be clear later on when we implement our own
|
||||
`Waker` we'll actually set up a `vtable` like we do here to and knowing what
|
||||
it is will make this much less mysterious.
|
||||
|
||||
## Reactor/Executor pattern
|
||||
|
||||
If you don't know what this is, you should take a few minutes and read about
|
||||
it. You will encounter the term `Reactor` and `Executor` a lot when working
|
||||
with async code in Rust.
|
||||
|
||||
I have written a quick introduction explaining this pattern before which you
|
||||
can take a look at here:
|
||||
|
||||
|
||||
[![homepage][1]][2]
|
||||
|
||||
<div style="text-align:center">
|
||||
<a href="https://cfsamsonbooks.gitbook.io/epoll-kqueue-iocp-explained/appendix-1/reactor-executor-pattern">Epoll, Kqueue and IOCP Explained - The Reactor-Executor Pattern</a>
|
||||
</div>
|
||||
|
||||
I'll re-iterate the most important parts here.
|
||||
|
||||
This pattern consists of at least 2 parts:
|
||||
|
||||
1. A reactor
|
||||
- handles some kind of event queue
|
||||
- has the responsibility of respoonding to events
|
||||
2. An executor
|
||||
- Often has a scheduler
|
||||
- Holds a set of suspended tasks, and has the responsibility of resuming
|
||||
them when an event has occurred
|
||||
3. The concept of a task
|
||||
- A set of operations that can be stopped half way and resumed later on
|
||||
|
||||
This is a pattern not only used in Rust, but it's very popular in Rust due to
|
||||
how well it separates concerns between handling and scheduling tasks, and queing
|
||||
and responding to I/O events.
|
||||
|
||||
The only thing Rust as a language defines is the _task_. In Rust we call an
|
||||
incorruptible task a `Future`. Futures has a well defined interface, which means
|
||||
they can be used across the entire ecosystem.
|
||||
|
||||
In addition, Rust provides a way for the Reactor and Executor to communicate
|
||||
through the `Waker`. We'll get to know these in the following chapters.
|
||||
|
||||
Providing these pieces let's Rust take care a lot of the ergonomic "friction"
|
||||
programmers meet when faced with async code, and still not dictate any
|
||||
preferred runtime to actually do the scheduling and I/O queues.
|
||||
|
||||
It's important to know that Rust doesn't provide a runtime, so you have to choose
|
||||
one. [async std](https://github.com/async-rs/async-std) and [tokio](https://github.com/tokio-rs/tokio) are two popular ones.
|
||||
|
||||
With that out of the way, let's move on to our main example.
|
||||
|
||||
|
||||
|
||||
|
||||
[1]: ./assets/reactorexecutor.png
|
||||
[2]: https://cfsamsonbooks.gitbook.io/epoll-kqueue-iocp-explained/appendix-1/reactor-executor-pattern
|
||||
it is will make this much less mysterious.
|
||||
@@ -1,12 +1,5 @@
|
||||
# Generators
|
||||
|
||||
So the second difficult part that there seems to be a lot of questions about
|
||||
is Generators and the `Pin` type. Since they're related we'll start off by
|
||||
undertanding generators first. By doing that we'll soon get to see why
|
||||
we need to be able to "pin" some data to a fixed location in memory and
|
||||
get an introduction to `Pin` as well.
|
||||
|
||||
|
||||
>**Relevant for:**
|
||||
>
|
||||
>- Understanding how the async/await syntax works since it's how `await` is implemented
|
||||
@@ -17,6 +10,12 @@ get an introduction to `Pin` as well.
|
||||
>well written and I can recommend reading through it (it talks as much about
|
||||
>async/await as it does about generators).
|
||||
|
||||
The second difficult part that there seems to be a lot of questions about
|
||||
is Generators and the `Pin` type. Since they're related we'll start off by
|
||||
exploring generators first. By doing that we'll soon get to see why
|
||||
we need to be able to "pin" some data to a fixed location in memory and
|
||||
get an introduction to `Pin` as well.
|
||||
|
||||
Basically, there were three main options that were discussed when Rust was
|
||||
desiging how the language would handle concurrency:
|
||||
|
||||
|
||||
120
src/1_3_pin.md
120
src/1_3_pin.md
@@ -1,4 +1,4 @@
|
||||
## Pin
|
||||
# Pin
|
||||
|
||||
> **Relevant for**
|
||||
>
|
||||
@@ -9,20 +9,53 @@
|
||||
>
|
||||
> `Pin` was suggested in [RFC#2349][rfc2349]
|
||||
|
||||
Pin consists of the `Pin` type and the `Unpin` marker. Let's start off with some general rules:
|
||||
We already got a brief introduction of `Pin` in the previous chapters, so we'll
|
||||
start off here with some definitions and a set of rules to remember.
|
||||
|
||||
1. Pin does nothing special, it only prevents the user of an API to violate some assumtions you make when writing your (most likely) unsafe code.
|
||||
2. Most standard library types implement `Unpin`
|
||||
3. `Unpin` means it's OK for this type to be moved even when pinned.
|
||||
4. If you `Box` a value, that boxed value automatcally implements `Unpin`.
|
||||
5. The main use case for `Pin` is to allow self referential types
|
||||
6. The implementation behind objects that doens't implement `Unpin` is most likely unsafe
|
||||
1. `Pin` prevents users from your code to break the assumtions you make when writing the `unsafe` implementation
|
||||
2. It doesn't solve the fact that you'll have to write unsafe code to actually implement it
|
||||
7. You're not really meant to be implementing `!Unpin`, but you can on nightly with a feature flag
|
||||
## Definitions
|
||||
|
||||
Pin consists of the `Pin` type and the `Unpin` marker. Pin's purpose in life is
|
||||
to govern the rules that need to apply for types which implement `!Unpin`.
|
||||
|
||||
> Unsafe code does not mean it's litterally "unsafe", it only relieves the
|
||||
Pin is only relevant for pointers. A reference to an object is a pointer.
|
||||
|
||||
Yep, that's double negation for you, as in "does-not-implement-unpin". For this
|
||||
chapter and only this chapter we'll rename these markers to:
|
||||
|
||||
> `!Unpin` = `MustStay` and `Unpin` = `CanMove`
|
||||
|
||||
It just makes it so much easier to understand them.
|
||||
|
||||
## Rules to remember
|
||||
|
||||
1. If `T: CanMove` (which is the default), then `Pin<'a, T>` is entirely equivalent to `&'a mut T`. in other words: `CanMove` means it's OK for this type to be moved even when pinned, so `Pin` will have no effect on such a type.
|
||||
|
||||
2. Getting a `&mut T` to a pinned pointer requires unsafe if `T: MustStay`. In other words: requiring a pinned pointer to a type which is `MustStay` prevents the _user_ of that API from moving that value unless it choses to write `unsafe` code.
|
||||
|
||||
3. Pinning does nothing special with that memory like putting it into some "read only" memory or anything fancy. It only tells the compiler that some operations on this value should be forbidden.
|
||||
|
||||
4. Most standard library types implement `CanMove`. The same goes for most
|
||||
"normal" types you encounter in Rust. `Futures` and `Generators` are two
|
||||
exceptions.
|
||||
|
||||
5. The main use case for `Pin` is to allow self referential types, the whole
|
||||
justification for stabilizing them was to allow that. There are still corner
|
||||
cases in the API which are being explored.
|
||||
|
||||
6. The implementation behind objects that are `MustStay` is most likely unsafe.
|
||||
Moving such a type can cause the universe to crash. As of the time of writing
|
||||
this book, creating an reading fields of a self referential struct still requires `unsafe`.
|
||||
|
||||
7. You're not really meant to be implementing `MustStay`, but you can on nightly with a feature flag, or by adding `std::marker::PhantomPinned` to your type.
|
||||
|
||||
8. When Pinning, you can either pin a value to memory either on the stack or
|
||||
on the heap.
|
||||
|
||||
1. Pinning a `MustStay` pointer to the stack requires `unsafe`
|
||||
|
||||
2. Pinning a `MustStay` pointer to the heap does not require `unsafe`. There is a shortcut for doing this using `Box::pin`.
|
||||
|
||||
> Unsafe code does not mean it's literally "unsafe", it only relieves the
|
||||
> guarantees you normally get from the compiler. An `unsafe` implementation can
|
||||
> be perfectly safe to do, but you have no safety net.
|
||||
|
||||
@@ -73,12 +106,42 @@ impl Test {
|
||||
}
|
||||
```
|
||||
|
||||
As you can see this results in unwanted behavior. The pointer to `b` stays the
|
||||
same and points to the old value. It's easy to get this to segfault, and fail
|
||||
in other spectacular ways as well.
|
||||
Let's walk through this example since we'll be using it the rest of this chapter.
|
||||
|
||||
Pin essentially prevents the **user** of your unsafe code
|
||||
(even if that means yourself) move the value after it's pinned.
|
||||
We have a self-referential struct `Test`. `Test` needs an `init` method to be
|
||||
created which is strange but we'll need that to keep this example as short as
|
||||
possible.
|
||||
|
||||
`Test` provides two methods to get a reference to the value of the fields
|
||||
`a` and `b`. Since `b` is a reference to `a` we store it as a pointer since
|
||||
the borrowing rules of Rust doesn't allow us to define this lifetime.
|
||||
|
||||
In our main method we first instantiate two instances of `Test` and print out
|
||||
the value of the fields on `test1`. We get:
|
||||
|
||||
```rust, ignore
|
||||
a: test1, b: test1
|
||||
```
|
||||
|
||||
|
||||
Next we swap the data stored at the memory location which `test1` is pointing to
|
||||
with the data stored at the memory location `test2` is pointing to and vice a verca.
|
||||
|
||||
We should expect that printing the fields of `test2` should display the same as
|
||||
`test1` (since the object we printed before the swap has moved there now).
|
||||
|
||||
```rust, ignore
|
||||
a: test1, b: test2
|
||||
```
|
||||
The pointer to `b` still points to the old location. That location is now
|
||||
occupied with the string "test2". This can be a bit hard to visualize so I made
|
||||
a figure that i hope can help.
|
||||
|
||||
**Fig 1: Before and after swap**
|
||||

|
||||
|
||||
As you can see this results in unwanted behavior. It's easy to get this to
|
||||
segfault, show UB and fail in other spectacular ways as well.
|
||||
|
||||
If we change the example to using `Pin` instead:
|
||||
|
||||
@@ -144,13 +207,12 @@ impl Test {
|
||||
```
|
||||
|
||||
Now, what we've done here is pinning a stack address. That will always be
|
||||
`unsafe` if our type implements `!Unpin`, in other words. That our type is not
|
||||
`Unpin` which is the norm.
|
||||
`unsafe` if our type implements `!Unpin` (aka `MustStay`).
|
||||
|
||||
We use some tricks here, including requiring an `init`. If we want to fix that
|
||||
and let users avoid `unsafe` we need to place our data on the heap.
|
||||
and let users avoid `unsafe` we need to pin our data on the heap instead.
|
||||
|
||||
Stack pinning will always depend on the current stack frame we're in, so we
|
||||
> Stack pinning will always depend on the current stack frame we're in, so we
|
||||
can't create a self referential object in one stack frame and return it since
|
||||
any pointers we take to "self" is invalidated.
|
||||
|
||||
@@ -203,19 +265,11 @@ impl Test {
|
||||
}
|
||||
```
|
||||
|
||||
Seeing this we're ready to sum up with a few more points to remember about
|
||||
pinning:
|
||||
|
||||
1. Pinning only makes sense to do for types that are `!Unpin`
|
||||
2. Pinning a `!Unpin` pointer to the stack will requires `unsafe`
|
||||
3. Pinning a boxed value will not require `unsafe`, even if the type is `!Unpin`
|
||||
4. If T: Unpin (which is the default), then Pin<'a, T> is entirely equivalent to &'a mut T.
|
||||
5. Getting a `&mut T` to a pinned pointer requires unsafe if `T: !Unpin`
|
||||
6. Pinning is really only useful when implementing self-referential types.
|
||||
For all intents and purposes you can think of `!Unpin` = self-referential-type
|
||||
|
||||
The fact that boxing (heap allocating) a value that implements `!Unpin` is safe
|
||||
makes sense. Once the data is allocated on the heap it will have a stable address.
|
||||
makes sense. Once the data is allocated on the heap it will have a stable address.
|
||||
|
||||
There is no need for us as users of the API to take special care and ensure
|
||||
that the self-referential pointer stays valid.
|
||||
|
||||
There are ways to safely give some guarantees on stack pinning as well, but right
|
||||
now you need to use a crate like [pin_utils]:[pin_utils] to do that.
|
||||
|
||||
91
src/1_4_reactor_executor.md
Normal file
91
src/1_4_reactor_executor.md
Normal file
@@ -0,0 +1,91 @@
|
||||
# Reactor/Executor Pattern
|
||||
|
||||
> **Relevant for:**
|
||||
>
|
||||
> - Getting a high level overview of a common runtime model in Rust
|
||||
> - Introducing these terms so we're on the same page when referring to them
|
||||
> - Getting pointers on where to get more information about this pattern
|
||||
|
||||
If you don't know what this is, you should take a few minutes and read about
|
||||
it. You will encounter the term `Reactor` and `Executor` a lot when working
|
||||
with async code in Rust.
|
||||
|
||||
I have written a quick introduction explaining this pattern before which you
|
||||
can take a look at here:
|
||||
|
||||
|
||||
[![homepage][1]][2]
|
||||
|
||||
<div style="text-align:center">
|
||||
<a href="https://cfsamsonbooks.gitbook.io/epoll-kqueue-iocp-explained/appendix-1/reactor-executor-pattern">Epoll, Kqueue and IOCP Explained - The Reactor-Executor Pattern</a>
|
||||
</div>
|
||||
|
||||
I'll re-iterate the most important parts here.
|
||||
|
||||
**This pattern consists of at least 2 parts:**
|
||||
|
||||
1. **A reactor**
|
||||
- handles some kind of event queue
|
||||
- has the responsibility of respoonding to events
|
||||
2. **An executor**
|
||||
- Often has a scheduler
|
||||
- Holds a set of suspended tasks, and has the responsibility of resuming
|
||||
them when an event has occurred
|
||||
3. **The concept of a task**
|
||||
- A set of operations that can be stopped half way and resumed later on
|
||||
|
||||
This kind of pattern common outside of Rust as well, but it's especially popular in Rust due to how well it alignes with the API provided by Rusts standard library. This model separates concerns between handling and scheduling tasks, and queing and responding to I/O events.
|
||||
|
||||
## The Reactor
|
||||
|
||||
Since concurrency mostly makes sense when interacting with the outside world (or
|
||||
at least some peripheral), we need something to actually abstract over this
|
||||
interaction in an asynchronous way.
|
||||
|
||||
This is the `Reactors` job. Most often you'll
|
||||
see reactors in rust use a library called [Mio][mio], which provides non
|
||||
blocking APIs and event notification for several platforms.
|
||||
|
||||
The reactor will typically give you something like a `TcpStream` (or any other resource) which you'll use to create an I/O request. What you get in return
|
||||
is a `Future`.
|
||||
|
||||
We can call this kind of `Future` a "leaf Future`, since it's some operation
|
||||
we'll actually wait on and that we can chain operations on which are performed
|
||||
once the leaf future is ready.
|
||||
|
||||
## The Task
|
||||
|
||||
In Rust we call an interruptible task a `Future`. Futures has a well defined interface, which means they can be used across the entire ecosystem. We can chain
|
||||
these `Futures` so that once a "leaf future" is ready we'll perform a set of
|
||||
operations.
|
||||
|
||||
These operations can spawn new leaf futures themselves.
|
||||
|
||||
## The executor
|
||||
|
||||
The executors task is to take one or more futures and run them to completion.
|
||||
|
||||
The first thing an `executor` does when it get's a `Future` is polling it.
|
||||
|
||||
**When polled one of three things can happen:**
|
||||
|
||||
- The future returns `Ready` and we schedule whatever chained operations to run
|
||||
- The future hasn't been polled before so we pass it a `Waker` and suspend it
|
||||
- The futures has been polled before but is not ready and returns `Pending`
|
||||
|
||||
Rust provides a way for the Reactor and Executor to communicate through the `Waker`. The reactor stores this `Waker` and calls `Waker::wake()` on it once
|
||||
a `Future` has resolved and should be polled again.
|
||||
|
||||
We'll get to know these concepts better in the following chapters.
|
||||
|
||||
Providing these pieces let's Rust take care a lot of the ergonomic "friction"
|
||||
programmers meet when faced with async code, and still not dictate any
|
||||
preferred runtime to actually do the scheduling and I/O queues.
|
||||
|
||||
|
||||
With that out of the way, let's move on to actually implement all this in our
|
||||
example.
|
||||
|
||||
[1]: ./assets/reactorexecutor.png
|
||||
[2]: https://cfsamsonbooks.gitbook.io/epoll-kqueue-iocp-explained/appendix-1/reactor-executor-pattern
|
||||
[mio]: https://github.com/tokio-rs/mio
|
||||
@@ -5,5 +5,6 @@
|
||||
- [Trait objects and fat pointers](./1_1_trait_objects.md)
|
||||
- [Generators and Pin](./1_2_generators_pin.md)
|
||||
- [Pin](./1_3_pin.md)
|
||||
- [Reactor/Executor Pattern](./1_4_reactor_executor.md)
|
||||
- [The main example](./2_0_future_example.md)
|
||||
- [Bonus 1: concurrent futures](2_1_concurrent_futures.md)
|
||||
|
||||
BIN
src/assets/swap_problem.jpg
Normal file
BIN
src/assets/swap_problem.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 165 KiB |
Reference in New Issue
Block a user