mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-17 04:09:03 +01:00
4e4c29175f
Co-authored-by: Jonas Platte <jplatte+git@posteo.de> Co-authored-by: Michael Scofield <mscofield0@tutanota.com>
23 lines
545 B
Rust
23 lines
545 B
Rust
use axum::{
|
|
extract::{FromRequest, TypedHeader, rejection::TypedHeaderRejection},
|
|
response::Response,
|
|
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() {}
|