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
56
57
58
59
60
//! # Resty
//!
//! Resty is a fast and lightweight framework for concurrent and multithreadable REST APIs.
//!
//!
//! ## Example
//!
//! ```rust
//! #[resty::use_manual_routing]
//! static ROUTER: LazyLock<Router>;
//!
//! #[resty::endpoint(
//! Router(ROUTER),
//! Path("/"),
//! Method(GET),
//! Header("Content-Type", "text/html; charset=utf-8")
//! )]
//! async fn get_hello_world<'a>(_req: &mut Request<'a>, res: &mut Response<'a, &'static str>) {
//! let _ = res.ok(&"Hello World!").await;
//! }
//!
//! fn main() -> ExitCode {
//! const ADDR: SocketAddrV4 = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 3333);
//!
//! resty::bind(ADDR, &ROUTER);
//!
//! println!("Listening on port 3333");
//!
//! let _: Vec<_> = std::thread::available_parallelism()
//! .ok()
//! .map(|n| 0..n.get())
//! .unwrap_or(0..1)
//! .map(|_| resty::spawn_thread())
//! .collect();
//!
//! std::thread::park();
//!
//! return ExitCode::SUCCESS;
//! }
//! ```
pub use ;
pub use *;
pub use *;
pub use *;