2022-08-23 21:14:02 +02:00
|
|
|
use axum::{
|
2023-04-11 16:09:48 +02:00
|
|
|
extract::FromRequestParts,
|
2022-08-23 21:14:02 +02:00
|
|
|
response::Response,
|
|
|
|
};
|
2023-04-11 16:09:48 +02:00
|
|
|
use axum_extra::{
|
|
|
|
TypedHeader,
|
|
|
|
typed_header::TypedHeaderRejection,
|
|
|
|
headers::{self, UserAgent},
|
|
|
|
};
|
2022-08-23 21:14:02 +02:00
|
|
|
|
|
|
|
#[derive(FromRequestParts)]
|
|
|
|
struct Extractor {
|
|
|
|
uri: axum::http::Uri,
|
|
|
|
user_agent: TypedHeader<UserAgent>,
|
|
|
|
content_type: TypedHeader<headers::ContentType>,
|
|
|
|
etag: Option<TypedHeader<headers::ETag>>,
|
|
|
|
host: Result<TypedHeader<headers::Host>, TypedHeaderRejection>,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn assert_from_request()
|
|
|
|
where
|
|
|
|
Extractor: FromRequestParts<(), Rejection = Response>,
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|