mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-09 00:00:12 +02:00
23 lines
542 B
Rust
23 lines
542 B
Rust
use axum::{
|
|||
|
|
extract::{rejection::TypedHeaderRejection, FromRequestParts, TypedHeader},
|
||
|
|
headers::{self, UserAgent},
|
||
|
|
response::Response,
|
||
|
|
};
|
||
|
|
|
||
|
|
#[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() {}
|