Skip to main content

RouterHelper

Derive Macro RouterHelper 

Source
#[derive(RouterHelper)]
{
    // Attributes available to this derive:
    #[router_config]
}
Expand description

Derive macro to generate helper methods for a router.

§Arguments

  • router_config - proc macro argument that start with the application’s state and followd by all the routers.

§Example

#[derive(RouterHelper)]
#[router_config(AppState, MyRouter, AnotherRouter, ...)]
struct MyRouter {
    // fields
}