2024-09-28 23:27:11 +02:00
|
|
|
use axum::extract::{FromRef, FromRequest, Request};
|
2022-08-18 11:41:14 +02:00
|
|
|
use axum_macros::debug_handler;
|
|
|
|
|
|
|
|
#[debug_handler(state = AppState)]
|
|
|
|
async fn handler(_: A) {}
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
struct AppState;
|
|
|
|
|
|
|
|
struct A;
|
|
|
|
|
2023-03-12 16:37:32 +01:00
|
|
|
impl<S> FromRequest<S> for A
|
2022-08-18 11:41:14 +02:00
|
|
|
where
|
|
|
|
S: Send + Sync,
|
|
|
|
AppState: FromRef<S>,
|
|
|
|
{
|
|
|
|
type Rejection = ();
|
|
|
|
|
2023-03-20 21:02:40 +01:00
|
|
|
async fn from_request(_req: Request, _state: &S) -> Result<Self, Self::Rejection> {
|
2022-08-18 11:41:14 +02:00
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|