mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-26 00:00:23 +02:00
This doesn't actually allow using non-Send or non-Sync state types, but it makes the docs simpler.
24 lines
414 B
Rust
24 lines
414 B
Rust
use axum::{async_trait, extract::FromRequest, http::Request};
|
|
use axum_macros::debug_handler;
|
|
|
|
struct A;
|
|
|
|
#[async_trait]
|
|
impl<S, B> FromRequest<S, B> for A
|
|
where
|
|
B: Send + 'static,
|
|
{
|
|
type Rejection = ();
|
|
|
|
async fn from_request(_req: Request<B>, _: &S) -> Result<Self, Self::Rejection> {
|
|
unimplemented!()
|
|
}
|
|
}
|
|
|
|
impl A {
|
|
#[debug_handler]
|
|
async fn handler(&mut self) {}
|
|
}
|
|
|
|
fn main() {}
|