Expand description
该库是axum-mongodb的核心库,主要提供其中宏相关的实现
提供以下宏
-
Column
:#[derive(Column)]
Derive宏,用于收集结构体元信息 -
main
:#[axum_mongodb::main]
属性宏,在main函数上使用,主要生成相关结构体,例如Servers、Server -
inject
:#[axum_mongodb::inject]
属性宏,用于axum handler上,主要作用是替换DBServers
到axum_mongodb::MongoDbServer<crate::Servers>
该库不支持直接使用,具体用法请查看axum_mongodb
Attribute Macros§
- inject
- 用于axum handler,用于替换extract类型,简化操作
- inject_
meta - 用于宏内部,将收集到的元信息注入到结构体中
- main
- 最主要的宏,为Server
实现[ axum::extract::FromRequestParts
]等
Derive Macros§
- Column
- Column Derive宏,用于收集结构体元信息,以及初始化mongodb的索引