mirror of
https://github.com/rwf2/Rocket.git
synced 2024-12-29 05:42:35 +00:00
ad36b769bc
...because loading up a Rocket while it's ignited is a bad idea. More seriously, because 'Rocket.ignite()' will become an "execute everything up to here" method.
15 lines
313 B
Rust
15 lines
313 B
Rust
use rocket::local::blocking::Client;
|
|
|
|
struct SpawnBlockingOnDrop;
|
|
|
|
impl Drop for SpawnBlockingOnDrop {
|
|
fn drop(&mut self) {
|
|
rocket::tokio::task::spawn_blocking(|| ());
|
|
}
|
|
}
|
|
|
|
#[test]
|
|
fn test_access_runtime_in_state_drop() {
|
|
Client::debug(rocket::build().manage(SpawnBlockingOnDrop)).unwrap();
|
|
}
|