Loading tutorials
Arc, and how to write a simple async fn and call .await. It does not need Pin or wakers. Later chapters cover those.2 min readasync fn code and called .await.2 min readFuture trait, and understand that Pin<&mut Self> means "a mutable reference to a value that will not move". Pinning and wakers get their own chapters, so here they are only used.2 min readasync fn code. It also assumes you have seen the Future trait and Poll from earlier chapters.2 min read.await a simple async fn. It also assumes you have seen the Future trait and Poll::Ready and Poll::Pending. Here you will see what the compiler builds from an async fn.2 min readFuture and Poll are, and that an executor calls poll until a future returns Poll::Ready. It also assumes you can read basic trait and Arc code.2 min readFuture trait, Poll, and what a Waker is for. You will implement a future yourself and see how the poll contract works.2 min readasync fn produces and that the compiler turns it into a state machine. Here you will see why that state machine can hold a reference to itself, and why moving it can then cause undefined behavior.2 min readFuture is. The previous chapter showed why a self-referential value breaks if it moves. Pin is the type that prevents that move.2 min readPin<P> promises (the value behind the pointer will not move) and why self-referential futures need that promise. Here we look at the escape hatch for types where moving is harmless, and at how to opt out of it.2 min readPin and Unpin mean, as covered in the previous chapters. Here you will learn the three tools you use to pin futures in everyday code.2 min readFuture, Poll, Context, and Waker are, and that you can pin a value with pin!. A future does nothing until something polls it. That something is an executor. Here you will build the smallest useful one.2 min readPin<&mut T>, Unpin, and how poll takes self: Pin<&mut Self>. It also assumes you have written a simple Future by hand.2 min readtokio crate, since the standard library has no join!, select!, or spawn. Add tokio = { version = "1", features = ["full"] } to Cargo.toml.2 min readpoll and Poll::Pending work, what an async fn compiles to (a state machine), and how Rust's Drop runs destructors.2 min readSend means for threads and that you have read the earlier chapters on state machines and executors.2 min readWaker does, and what a minimal block_on looks like. It builds on those ideas to show what a full runtime adds and what goes wrong when a task blocks.2 min read