mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-29 15:49:16 +01:00
877e3fe4de
Co-authored-by: Michael Scofield <mscofield0@tutanota.com> Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
26 lines
572 B
Rust
26 lines
572 B
Rust
use axum::{
|
|
extract::FromRequestParts,
|
|
response::Response,
|
|
};
|
|
use axum_extra::{
|
|
TypedHeader,
|
|
typed_header::TypedHeaderRejection,
|
|
headers::{self, UserAgent},
|
|
};
|
|
|
|
#[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() {}
|