mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-28 07:20:12 +01:00
23 lines
561 B
Rust
23 lines
561 B
Rust
use axum::{extract::FromRequestParts, response::Response};
|
|
use axum_extra::{
|
|
headers::{self, UserAgent},
|
|
typed_header::TypedHeaderRejection,
|
|
TypedHeader,
|
|
};
|
|
|
|
#[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() {}
|