Rocket/examples
Sergio Benitez 0bdb6b7bc7 Remove 'attach' fairings. Add 'liftoff' fairings.
Launch fairings are now fallible and take the place of attach fairings,
but they are only run, as the name implies, at launch time.

This is is a fundamental shift from eager execution of set-up routines,
including the now defunct attach fairings, to lazy execution,
precipitated by the transition to `async`. The previous functionality,
while simple, caused grave issues:

  1. A instance of 'Rocket' with async attach fairings requires an async
     runtime to be constructed.
  2. The instance is accessible in non-async contexts.
  3. The async attach fairings have no runtime in which to be run.

Here's an example:

```rust
let rocket = rocket::ignite()
    .attach(AttachFairing::from(|rocket| async {
        Ok(rocket.manage(load_from_network::<T>().await))
    }));

let state = rocket.state::<T>();
```

This had no real meaning previously yet was accepted by running the
attach fairing future in an isolated runtime. In isolation, this causes
no issue, but when attach fairing futures share reactor state with other
futures in Rocket, panics ensue.

The new Rocket application lifecycle is this:

  * Build - A Rocket instance is constructed. No fairings are run.
  * Ignition - All launch fairings are run.
  * Liftoff - If all launch fairings succeeded, the server is started.

New 'liftoff' fairings are run in this third phase.
2021-04-07 23:09:00 -07:00
..
config Remove 'attach' fairings. Add 'liftoff' fairings. 2021-04-07 23:09:00 -07:00
content_types Introduce scoped catchers. 2021-03-28 13:57:33 -07:00
cookies Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
errors Introduce scoped catchers. 2021-03-28 13:57:33 -07:00
fairings Remove 'attach' fairings. Add 'liftoff' fairings. 2021-04-07 23:09:00 -07:00
forms Explicitly specify 'template_dir' in forms example. 2021-03-17 18:34:05 -07:00
handlebars_templates Introduce scoped catchers. 2021-03-28 13:57:33 -07:00
hello_2018 Introduce scoped catchers. 2021-03-28 13:57:33 -07:00
hello_person Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
hello_world Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
json Introduce scoped catchers. 2021-03-28 13:57:33 -07:00
managed_queue Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
manual_routes Introduce scoped catchers. 2021-03-28 13:57:33 -07:00
msgpack Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
optional_redirect Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
pastebin Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
query_params Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
ranking Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
raw_sqlite Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
raw_upload Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
redirect Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
request_guard Remove second lifetime from 'FromRequest'. 2021-03-14 19:57:59 -07:00
request_local_state Remove second lifetime from 'FromRequest'. 2021-03-14 19:57:59 -07:00
session Remove second lifetime from 'FromRequest'. 2021-03-14 19:57:59 -07:00
state Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
static_files Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
stream Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
tera_templates Introduce scoped catchers. 2021-03-28 13:57:33 -07:00
testing Remove 'attach' fairings. Add 'liftoff' fairings. 2021-04-07 23:09:00 -07:00
tls Generate CA cert in 'gen_certs.sh'. 2021-03-17 18:25:06 -07:00
todo Remove 'attach' fairings. Add 'liftoff' fairings. 2021-04-07 23:09:00 -07:00
uuid Move examples to their own workspace. 2021-03-09 21:57:30 -08:00
Cargo.toml Move examples to their own workspace. 2021-03-09 21:57:30 -08:00