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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//! # Oblivion
//!
//! Oblivion is a Rust implementation of Oblivion, an end-to-end encryption protocol developed by Noctisynth to secure information.
//! It greatly improves the security, stability, and concurrency of Oblivion based on the Python implementation.
//!
//! Since the encryption algorithm required in the Oblivion protocol is the ECDHE algorithm,
//! it is based on an efficient and secure key derivation method,
//! which makes it possible to apply it to message dispatching and just-in-time communication.
pub extern crate oblivion_codegen;
pub extern crate proc_macro;
/// # Oblivion Exceptions
/// # Oblivion Export Types
/// # Oblivion Prelude
/// # Oblivion Utilities
///
/// Oblivion utility classes provide key creation, data encryption and decryption, and request resolution processing methods.
/// # Oblivion Models
///
/// Oblivion provides all front- and back-end models, including packet building as well as client-side and server-side building.
/// Absolute Routing Macros
///
/// Routing can be simply implemented using routing macros:
///
/// ```rust
/// use oblivion::path_route;
/// use oblivion::models::render::BaseResponse;
/// use oblivion::types::ServerResponse;
/// use oblivion_codegen::async_route;
/// use oblivion::models::router::Router;
/// use oblivion::models::session::Session;
///
/// #[async_route]
/// fn welcome(mut session: Session) -> ServerResponse {
/// Ok(BaseResponse::TextResponse(
/// format!("欢迎进入信息绝对安全区, 来自[{}]的朋友", session.get_ip()),
/// ))
/// }
///
/// let mut router = Router::new();
/// path_route!(&mut router, "/welcome" => welcome);
/// ```
///
/// The above route will direct requests with the path `/welcome` or `/welcome/`.
/// Startswith Routing Macros
///
/// Starting routes can be simply implemented using the start route macro:
///
/// ```rust
/// use oblivion::startswith_route;
/// use oblivion::models::render::BaseResponse;
/// use oblivion::types::ServerResponse;
/// use oblivion_codegen::async_route;
/// use oblivion::models::router::Router;
/// use oblivion::models::session::Session;
///
/// #[async_route]
/// fn welcome(mut session: Session) -> ServerResponse {
/// Ok(BaseResponse::TextResponse(
/// format!("欢迎进入信息绝对安全区, 来自[{}]的朋友", session.get_ip()),
/// ))
/// }
///
/// let mut router = Router::new();
/// startswith_route!(router, "/welcome" => welcome);
/// ```
///
/// The above route will direct all Oblivion Location Path String starting with `/welcome`.
/// Regular routing macro
///
/// Regular routing can be simply implemented using regular routing macros:
///
/// ```rust
/// use oblivion::regex_route;
/// use oblivion::models::render::BaseResponse;
/// use oblivion::types::ServerResponse;
/// use oblivion_codegen::async_route;
/// use oblivion::models::router::Router;
/// use oblivion::models::session::Session;
///
/// #[async_route]
/// fn welcome(mut session: Session) -> ServerResponse {
/// Ok(BaseResponse::TextResponse(
/// format!("欢迎进入信息绝对安全区, 来自[{}]的朋友", session.get_ip()),
/// ))
/// }
///
/// let mut router = Router::new();
/// regex_route!(router, r"^/welcome/.*" => welcome);
/// ```
///
/// The above route will direct all Oblivion Location Path String starting with `/welcome/`.
///
/// You can also use `^/. *` to hijack all routes.
pub static VERSION: &str = env!;