1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! The `run` helper — bind a `TcpListener` and serve the application on the
//! certified Tokio runtime.
//!
//! Gated by the `macros` feature, which brings in the already-vetted `tokio`
//! runtime with `macros`, `rt-multi-thread`, `net`, and `signal`. A normal
//! application pairs `#[arcature::main]` with `Application::run`:
//!
//! ```ignore
//! use arcature::prelude::*;
//!
//! #[arcature::main]
//! async fn main() -> Result<()> {
//! Application::new()
//! .routes(Routes::new().route("/", get(|| async { "ok" })))
//! .run()
//! .await
//! }
//! ```
//!
//! Expert users who want their own runtime, listener, or shutdown signal can
//! skip this helper and call `Application::serve` or
//! `Application::serve_with_shutdown` directly (engine spec §21/§23).
use crateApplication;
use crate;
/// Bind-and-serve on the certified Tokio runtime.