9 releases (stable)

1.4.1 Dec 27, 2023
1.4.0 Aug 20, 2023
1.0.0 Jun 25, 2022
0.1.2 Jun 24, 2022

#2083 in Procedural macros


Used in summer-boot

Apache-2.0

28KB
496 lines

Summer Boot Macro

Used to write all macros of summer boot

Getting Started

summer-boot-macro = "1.4.0"

Macro description

1. Macro attribute summer_boot::main

This macro is mainly used to start asynchronous methods and create a new instance of summer boot

#[summer_boot::main]
async fn main() {
    async { println!("Hello world"); }.await
}

2. Macro attribute summer_boot::auto_scan

This macro is mainly used to automatically scan the workspace or under a single project API, and to automatically complete the scanning of YML configuration files under the resource directory

#[summer_boot::auto_scan]
async fn main() {
    summer_boot::run();
}

lib.rs:

运行时宏处理

main

使用运行时宏来设置summerboot async运行时。参见[main]宏文档。

auto_scan

提供了基础的auto_scan功能用于发现并自动注册路由。

post、get、delete、put、patch、head、options、connect、trace

提供了简单的路由宏标注。

Dependencies

~2.5–3.5MB
~75K SLoC