boluo_macros/
lib.rs

1//! `boluo` 的宏。
2
3#![forbid(unsafe_code)]
4#![warn(
5    missing_debug_implementations,
6    missing_docs,
7    rust_2018_idioms,
8    unreachable_pub
9)]
10#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg))]
11
12mod route;
13
14use proc_macro::TokenStream;
15
16/// 为处理程序添加请求路径和方法。
17///
18/// # 例子
19///
20/// ```ignore
21/// #[boluo::route("/", method = "GET")]
22/// async fn hello() -> &'static str {
23///     "Hello, World!"
24/// }
25/// ```
26#[proc_macro_attribute]
27pub fn route(attr: TokenStream, item: TokenStream) -> TokenStream {
28    route::route(attr, item)
29}