Attribute Macro axum_mongodb_core::inject
source · #[inject]
Expand description
用于axum handler,用于替换extract类型,简化操作
Example
#[axum_mongodb::inject]
async fn db_test(servers: DBServers) -> impl IntoResponse {
let db_name = servers.db.name();
Json(json!({
"db_name":db_name
}))
}