#mongo-db #axum #macro

macro axum-mongodb-core

the core of axum-mongodb

5 releases

1.0.3 Jan 7, 2024
0.2.2 Jan 12, 2024
0.1.1 Jan 6, 2024

#115 in #mongo-db

Download history 1/week @ 2023-12-30 41/week @ 2024-01-06 2/week @ 2024-01-13 5/week @ 2024-02-17

93 downloads per month
Used in axum-mongodb

MIT license

27KB
642 lines

该库是axum-mongodb的核心库,主要提供其中宏相关的实现

提供以下宏

  • Column:#[derive(Column)]Derive宏,用于收集结构体元信息
  • main:#[axum_mongodb::main]属性宏,在main函数上使用,主要生成相关结构体,例如Servers、Server
  • Inject:#[axum_mongodb::inject]属性宏,用于axum handler上,主要作用是替换DBServersaxum_mongodb::MongoDbServer<crate::Servers>

该库不支持直接使用,具体用法请查看axum_mongodb


lib.rs:

该库是axum-mongodb的核心库,主要提供其中宏相关的实现

提供以下宏

  • Column#[derive(Column)]Derive宏,用于收集结构体元信息

  • [macro@main]:#[axum_mongodb::main]属性宏,在main函数上使用,主要生成相关结构体,例如Servers、Server

  • [macro@inject]:#[axum_mongodb::inject]属性宏,用于axum handler上,主要作用是替换DBServersaxum_mongodb::MongoDbServer<crate::Servers>

该库不支持直接使用,具体用法请查看axum_mongodb

Dependencies

~0.4–0.8MB
~19K SLoC