Skip to main content

Crate nidus_macros

Crate nidus_macros 

Source
Expand description

Procedural macros for Nidus modules, providers, controllers, and routes.

The examples in this crate are marked ignore because application-facing macro use goes through the nidus facade crate, which depends on this proc-macro crate. Adding a reverse doctest dependency here would create a crate cycle. Macro expansion behavior is covered by the facade UI and CLI tests instead.

Attribute Macrosยง

controller
Declares the path prefix for a controller type.
delete
Declares a DELETE handler inside a #[routes] impl block.
get
Declares a GET handler inside a #[routes] impl block.
guard
Declares guard metadata for a controller route method.
injectable
Declares a struct as an injectable provider.
main
Runs an async Nidus entrypoint on a Tokio runtime.
module
Declares a Nidus module from a Rust struct.
openapi
Declares OpenAPI metadata for a controller route method.
patch
Declares a PATCH handler inside a #[routes] impl block.
pipe
Declares pipe metadata for a controller route method.
post
Declares a POST handler inside a #[routes] impl block.
put
Declares a PUT handler inside a #[routes] impl block.
routes
Generates route metadata and executable Axum routers for a controller impl.
validate
Marks a controller route method as participating in validation metadata.