nestrs-macros 0.1.3

Proc-macro support for nestrs module/controller/route ergonomics.
Documentation

nestrs-macros

Procedural macros for nestrs: #[module], #[controller], HTTP verbs (#[get], #[post], …), #[injectable], validation/DTO helpers, WebSocket routing (#[ws_routes]), microservice patterns (#[micro_routes], #[message_pattern]), and more.

This crate is a proc-macro dependency of nestrs; you do not usually add it explicitly unless you are experimenting with macro expansion or building a fork.

Docs: docs.rs/nestrs-macros · Repo: github.com/Joshyahweh/nestrs

Install (normal apps)

Prefer the umbrella crate:

nestrs = "0.1.3"

nestrs already depends on nestrs-macros.

Install (macro-only experiments)

[dependencies]
nestrs-macros = "0.1.3"

What you get (surface sketch)

Application code typically uses attributes from nestrs, which re-exports the macros:

use nestrs::prelude::*;

#[module(controllers = [ApiController], providers = [AppService])]
struct AppModule;

#[controller(prefix = "/api")]
#[routes(state = AppState)]
impl ApiController {
    #[get("/health")]
    async fn health() -> &'static str {
        "ok"
    }
}

See docs.rs/nestrs for the full attribute reference.

License

MIT OR Apache-2.0.