axum/axum-macros/tests/debug_handler/pass/state_and_body.rs
David Pedersen 568394a28e
Support changing state type in #[debug_handler] (#1271)
* support setting body type for #[debug_handler]

* Use lookahead1 to give better errors and detect duplicate arguments

* fix docs link
2022-08-18 11:41:14 +02:00

10 lines
252 B
Rust

use axum_macros::debug_handler;
use axum::{body::BoxBody, extract::State, http::Request};
#[debug_handler(state = AppState, body = BoxBody)]
async fn handler(_: State<AppState>, _: Request<BoxBody>) {}
#[derive(Clone)]
struct AppState;
fn main() {}