2022-08-18 11:41:14 +02:00
|
|
|
use axum_macros::debug_handler;
|
2022-08-22 12:23:20 +02:00
|
|
|
use axum::extract::{FromRef, FromRequest};
|
2022-08-18 11:41:14 +02:00
|
|
|
use axum::async_trait;
|
2022-08-22 12:23:20 +02:00
|
|
|
use axum::http::Request;
|
2022-08-18 11:41:14 +02:00
|
|
|
|
|
|
|
|
#[debug_handler(state = AppState)]
|
|
|
|
|
async fn handler(_: A) {}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
|
struct AppState;
|
|
|
|
|
|
|
|
|
|
struct A;
|
|
|
|
|
|
|
|
|
|
#[async_trait]
|
|
|
|
|
impl<S, B> FromRequest<S, B> for A
|
|
|
|
|
where
|
2022-08-22 12:23:20 +02:00
|
|
|
B: Send + 'static,
|
2022-08-18 11:41:14 +02:00
|
|
|
S: Send + Sync,
|
|
|
|
|
AppState: FromRef<S>,
|
|
|
|
|
{
|
|
|
|
|
type Rejection = ();
|
|
|
|
|
|
2022-08-22 12:23:20 +02:00
|
|
|
async fn from_request(_req: Request<B>, _state: &S) -> Result<Self, Self::Rejection> {
|
2022-08-18 11:41:14 +02:00
|
|
|
unimplemented!()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|