From 95314dd35dea53aca5226dfd5f716a7d2765bb69 Mon Sep 17 00:00:00 2001 From: Carl Fredrik Samson Date: Sat, 1 Feb 2020 18:42:18 +0100 Subject: [PATCH] made a theme which shows code comments clearer --- book/1_background_information.html | 32 +- book/2_trait_objects.html | 23 +- book/3_generators_pin.html | 34 ++- book/4_pin.html | 25 +- book/6_future_example.html | 41 ++- book/7_conclusion.html | 286 ------------------ book/8_finished_example.html | 27 +- book/highlight.css | 117 ++++--- book/index.html | 29 +- ...{0_introduction.html => introduction.html} | 29 +- book/print.html | 148 ++++----- book/searchindex.js | 2 +- book/searchindex.json | 2 +- src/3_generators_pin.md | 5 +- theme/highlight.css | 68 +++++ 15 files changed, 367 insertions(+), 501 deletions(-) delete mode 100644 book/7_conclusion.html rename book/{0_introduction.html => introduction.html} (87%) create mode 100644 theme/highlight.css diff --git a/book/1_background_information.html b/book/1_background_information.html index 91bd8e8..6a8286d 100644 --- a/book/1_background_information.html +++ b/book/1_background_information.html @@ -78,7 +78,7 @@ @@ -167,13 +167,14 @@ pretty simple. I promise.

Async in Rust

Let's get some of the common roadblocks out of the way first.

Async in Rust is different from most other languages in the sense that Rust -has an extremely lightweight runtime.

-

In languages like C#, JavaScript, Java and GO, the runtime is already there. So -if you come from one of those languages this will seem a bit strange to you.

+has a very lightweight runtime.

+

In languages like C#, JavaScript, Java and GO, already includes a runtime +for handling concurrency. So if you come from one of those languages this will +seem a bit strange to you.

What Rust's standard library takes care of

  1. The definition of an interruptible task
  2. -
  3. An extremely efficient technique to start, suspend, resume and store tasks +
  4. An efficient technique to start, suspend, resume and store tasks which are executed concurrently.
  5. A defined way to wake up a suspended task
@@ -212,7 +213,7 @@ to know in advance.

A good sign is that if you're required to use combinators like and_then then you're using Futures 1.0.

While not directly compatible, there is a tool that let's you relatively easily -convert a Future 1.0 to a Future 3.0 and vice a verca. You can find all you +convert a Future 1.0 to a Future 3.0 and vice a versa. You can find all you need in the futures-rs crate and all information you need here.

First things first

If you find the concepts of concurrency and async programming confusing in @@ -236,7 +237,7 @@ you're back.