mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-17 04:09:03 +01:00
877e3fe4de
Co-authored-by: Michael Scofield <mscofield0@tutanota.com> Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
27 lines
575 B
Rust
27 lines
575 B
Rust
use axum::{
|
|
extract::FromRequest,
|
|
response::Response,
|
|
};
|
|
use axum_extra::{
|
|
TypedHeader,
|
|
typed_header::TypedHeaderRejection,
|
|
headers::{self, UserAgent},
|
|
};
|
|
|
|
#[derive(FromRequest)]
|
|
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>,
|
|
body: String,
|
|
}
|
|
|
|
fn assert_from_request()
|
|
where
|
|
Extractor: FromRequest<(), Rejection = Response>,
|
|
{
|
|
}
|
|
|
|
fn main() {}
|